From 56126108b2610f82bc7cafaac8741d1aeba1d34f Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 4 May 1997 21:23:13 +0200 Subject: [PATCH] release: 0.0.59 --- .version | 2 +- Documentation/MANIFESTO.pod | 5 ++ Documentation/faq.pod | 18 ++--- Documentation/mudela.pod | 14 ++++ NEWS | 12 ++- TODO | 67 ++++++----------- bin/Makefile | 1 + bin/convert-mudela | 21 +++++- bin/lily.efence | 4 + init/register.ini | 4 +- init/symbol.ini | 2 +- init/table_sixteen.ini | 4 +- input/cadenza.ly | 35 +++++---- input/collisions.ly | 24 ++++-- input/coriolan-alto.ly | 24 +++--- input/error.ly | 4 +- input/header.ly | 22 +++--- input/kortjakje.ly | 31 +++++--- input/pedal.ly | 2 +- input/rhythm.ly | 4 +- input/scales.ly | 2 +- input/scsii-menuetto.ly | 20 ++--- input/slurs.ly | 38 ++++++++++ input/standchen.ly | 68 +++++++++-------- input/toccata-fuga-E.ly | 16 ++-- input/twinkle.ly | 25 ++++-- input/wohltemperirt.ly | 34 ++++----- lily/.version | 4 +- lily/bow.cc | 56 ++++++++++++++ lily/directional-spanner.cc | 5 ++ lily/include/bow.hh | 29 +++++++ lily/include/directional-spanner.hh | 2 +- lily/include/item.hh | 15 ++++ lily/include/lily-proto.hh | 3 + lily/include/musical-request.hh | 10 +++ lily/include/note-column.hh | 5 +- lily/include/slur-reg.hh | 1 + lily/include/slur.hh | 17 ++--- lily/include/tie-reg.hh | 34 +++++++++ lily/include/tie.hh | 27 +++++++ lily/item.cc | 6 ++ lily/musical-request.cc | 4 + lily/my-lily-parser.cc | 3 + lily/note-column.cc | 8 +- lily/p-score.cc | 4 +- lily/parser.y | 7 +- lily/score.cc | 4 +- lily/slur-reg.cc | 16 ++-- lily/slur.cc | 113 +++++++--------------------- lily/spanner.cc | 1 + lily/stem.cc | 2 +- lily/tie-reg.cc | 97 ++++++++++++++++++++++++ lily/tie.cc | 63 ++++++++++++++++ make/lilypond.lsm | 6 +- make/lilypond.spec | 6 +- tex/dimen.tex | 2 +- 56 files changed, 731 insertions(+), 322 deletions(-) create mode 100644 bin/lily.efence create mode 100644 input/slurs.ly create mode 100644 lily/bow.cc create mode 100644 lily/include/bow.hh create mode 100644 lily/include/tie-reg.hh create mode 100644 lily/include/tie.hh create mode 100644 lily/tie-reg.cc create mode 100644 lily/tie.cc diff --git a/.version b/.version index 0ca2b3e656..7db091cf9c 100644 --- a/.version +++ b/.version @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 58 +TOPLEVEL_PATCH_LEVEL = 59 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/Documentation/MANIFESTO.pod b/Documentation/MANIFESTO.pod index 7808c4bb19..2ceaf525c1 100644 --- a/Documentation/MANIFESTO.pod +++ b/Documentation/MANIFESTO.pod @@ -29,6 +29,11 @@ Generate high-quality output. Ideally it should be of a professional quality. We'd like to render Herbert Chlapiks words, "Fine music setting is not possible without a knowledgeable printer," untrue. +=item * + +Make a which system which fully tweakable. It should be possible to +typeset a book on how not to typeset music. + =back =head1 LILYPOND diff --git a/Documentation/faq.pod b/Documentation/faq.pod index e2e9b63818..4aeef3751f 100644 --- a/Documentation/faq.pod +++ b/Documentation/faq.pod @@ -35,13 +35,13 @@ Q: I can type to make a few chords, but why do I have to type - < { a() e } { c () g } > + < { a~ e } { c ~ g } > instead of - <)e )g> + -to generate slurs between the chords? +to generate ties between the chords? A: When you type @@ -51,14 +51,14 @@ this is shorthand for < { a } { c } > < { e } { g } > -Slurs have to be confined to `voices', and the a and the e are in +Ties have to be confined to `voices', and the a and the e are in different {} blocks, so they are in different voices. You should view the desired construct as a "generalised chord" (two voices stacked vertically). It might help you visualise this by using the following formatting: - < { a () e } - { c () g } + < { a ~ e } + { c ~ g } > Q: and where do the beams come into this picture? @@ -66,9 +66,9 @@ Q: and where do the beams come into this picture? A: Beams are voicegroup-wide, and may be entered in any part of the voicegroup: - < { [a () e] } { c () g } > - < { [a () e } { c () g] } > - < { [a () e] } { [c () g] } > + < { [a ~ e] } { c ~ g } > + < { [a ~ e } { c ~ g] } > + < { [a ~ e] } { [c ~ g] } > These all give the same result. diff --git a/Documentation/mudela.pod b/Documentation/mudela.pod index c46ccc58c0..5908a64610 100644 --- a/Documentation/mudela.pod +++ b/Documentation/mudela.pod @@ -240,6 +240,20 @@ error for this reason. % NO nesting! [c8 c8 c8]2/3 % 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: diff --git a/NEWS b/NEWS index 9bbb2e1f44..f01134bef9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +pl 59 + - Slur now into voicegroups, and take stems into account. + - bf: rest size in table. + - split Slur in baseclass Bow + - Tie, Tie_req, Tie_register + +****** +may 2 pl 58 - lexer cleanup - national chars in lyrics @@ -20,7 +28,7 @@ pl 57.jcn2 - small toccata-fuga-E.ly fixes - \bar "||"; is now doublebar, "|." is finishbar - collision hshift fix, with on-line assistance - +****** pl 57 - lots of TODO doco - text alignment bugfix @@ -62,7 +70,7 @@ pl 55 - script-on-rest bug - doc update - transpose syntax - +****** pl 54 - bugfix Colhpos.cc::OK assert fail. - Inclusion of MusixTeX MF files, diff --git a/TODO b/TODO index 839412f6ed..ec850fd0c7 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,17 @@ +This is an assorted collection of stuff that will be done, might be +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 + + IMPORTANT * update 20 pt table + * use Hungarian throughout code + * rename mf fonts to avoid conflicts with musixtex * decent TeX page layout @@ -11,34 +20,30 @@ IMPORTANT * script priority - * slur direction - * use own fonts/update musixtex fonts * check return status in make_website * a Hands on tutorial [HKN] -This is an assorted collection of stuff that will be done, might be -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 +PROJECT: + + * Output class, handles + - help text /(c) notice? + - warning /errors/progress + - abort on error/warning; exit status + - quiet/ignore-version options + - logfile output PARSER * Duration-> Musical_duration, typedef Rational Duration? HKN buglist: -exitcode? (altijd 0) - \bar || ook dunne streepjes? Sluit de balk niet af! (soms met de ruimte van een hele maat erachter (bij unmatching staffs) -logfile? - -Gepunteerde rusten kloppen niet (punt eronder/boven ipv ernaast) - Hele rusten ook in andere maatsoort dan 4/4 (en centreren in de maat) @@ -48,7 +53,7 @@ barcheck failed in lyric mode -> assert (zie barcheck.ly) (0.0.57) ------------------------/ optie om te stoppen na eerste barcheck fail? (en wellicht in eerder -stadium van precessing) +stadium van preprocessing) noten staan vaak te dicht aan de rechterkant van de maatstreep. @@ -62,8 +67,6 @@ script ^"3" onder ondanks boven? symbolen voor triller? (dus "tr---") -mogelijkheid om complete regions te commenten (met /* */ ofzo) - waarom geen ; achter dingen in \paper? (\textwidth 180\mm) (sowieso: wanneer wel en geen ; ?) @@ -77,28 +80,6 @@ midi: instrumenten definieren? midi: tempo halverwege het stuk wijzigen? midi: gebonden noten niet herhalen? -TeX literals invoegen? - ---------/\ -Dit geeft gigantische trubbels - < [d8.( e'32*2/3 d'32*2/3 cis'32*2/3 b16 d'16 cis'16 )b'16] - [b8. cis'32*2/3 b32*2/3 a32*2/3 gis16 fis16 e16 d16] > -(zie file junkjunk.ly) Ik had natuurlijk wat accolades moeten -plaatsen, maar ja... - ---------/\ -Inconsequent: ene keer wel, andere keer niet parse error? -ipt.ini][/usr/local/share/lilypond/init//table_sixteen.ini]]./lacidarem.ly: 56: -error: parse error: - <[d8. b8.> \duration 32; -./lacidarem.ly: 56: error: parse error: - <[d8. b8.> \duration 32; -./lacidarem.ly: 57: error: parse error: - \duration 16; | -]./lacidarem.ly: 65: warning: Score contains errors. Will not process it. : --------/\ De beam van de triool klopt niet. <[d8. b8.> \duration 32; @@ -135,13 +116,15 @@ BUGS * [c8. c32 c32] + * \duration 8; e*2/3 + * cis ( | ) cis * lilypond - -> crash * chlapik balk ruimte - * standchen triool beam up/down + * standchen triool beam up/down SEVERELY LACKING: @@ -203,8 +186,6 @@ SMALLISH PROJECTS * caching breakpoints / saving them. - * hack ElectricFence to use with LD_PRELOAD - * use dstream feature in mi2mu * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc. @@ -264,8 +245,6 @@ DOC FUTURE - * tie a ~ b, move slur reg into voice-group. - * Reg_configure_request * bring Collision::do_pre_processing to haircutter @@ -340,8 +319,6 @@ IDEAS * SHIT: meters/bars should be aligned, which is difficult if we get different keychanges in different staffs. - * Integrating (objectiveC) MusicKit with LilyPond? - * MusixTeX output possible? * PostScript output (esp. Beams, Slurs, etc) @@ -353,8 +330,6 @@ IDEAS * caching breakpoints - * use exceptions iso assert? - * #c <-> cis * breath marks diff --git a/bin/Makefile b/bin/Makefile index ed0e8522ae..faa5163efe 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -7,6 +7,7 @@ include $(depth)/make/Include.make # list of distribution files: SCRIPTS = clearlily cpgento genheader make_patch \ + lily.efence\ make_version make_website release convert-mudela show-latest EXTRA_DISTFILES = $(SCRIPTS) # diff --git a/bin/convert-mudela b/bin/convert-mudela index dbb0f729a4..d728b1fed3 100755 --- a/bin/convert-mudela +++ b/bin/convert-mudela @@ -1,9 +1,20 @@ #!/usr/bin/perl -w +=head1 TODO + + detect \lyrics and \melodic, and do substitution accordingly. + +=cut + + + # # version of "supporting" engine, not mudela conversions. # + + + $convert_mudela_version = "0.1"; use Getopt::Long; @@ -46,6 +57,11 @@ sub convert_0_0_55_to_0_0_56 s/\"\|\|\"/\"|.\"/g; } +sub convert_0_0_56_to_0_0_57 +{ + s/\(([ \]\[|\t-\.>]|\\[a-z]+)*\)/\~ $1/g; +} + ############################################################### sub last_conversion @@ -80,8 +96,9 @@ my %minor_conversions = (50 => \&no_conv, 53 => \&convert_0_0_52_to_0_0_53, 54 => \&convert_0_0_53_to_0_0_54, 55 => \&convert_0_0_54_to_0_0_55, - 56 => \&convert_0_0_55_to_0_0_56 - ); + 56 => \&convert_0_0_55_to_0_0_56, + 57 => \&convert_0_0_56_to_0_0_57 + ); sub versions diff --git a/bin/lily.efence b/bin/lily.efence new file mode 100644 index 0000000000..9bed942de5 --- /dev/null +++ b/bin/lily.efence @@ -0,0 +1,4 @@ +# gdb script +file bin/lilypond +set environment LD_PRELOAD libefence.so + diff --git a/init/register.ini b/init/register.ini index 4168de973d..154800fdc7 100644 --- a/init/register.ini +++ b/init/register.ini @@ -9,6 +9,7 @@ melodicregs = \inputregister { \inputregister {Local_key_register} \inputregister { Staff_sym_register } \inputregister { Collision_register } + \inputregister { Rest_collision_register } \inputregister { Voice_group_registers \inputregister { Dynamic_register } @@ -16,9 +17,10 @@ melodicregs = \inputregister { \inputregister { Text_register } \inputregister { Script_register } \inputregister { Note_column_register } + \inputregister { Slur_register } \inputregister { Voice_registers \inputregister { Notehead_register } - \inputregister { Slur_register } + \inputregister { Tie_register } } } } diff --git a/init/symbol.ini b/init/symbol.ini index 715ee9db7f..898ca8f419 100644 --- a/init/symbol.ini +++ b/init/symbol.ini @@ -1,4 +1,4 @@ -\version "0.0.56"; +\version "0.0.57"; \include "register.ini" \include "dynamic.ini" diff --git a/init/table_sixteen.ini b/init/table_sixteen.ini index b93ddb7b31..a205cddaff 100644 --- a/init/table_sixteen.ini +++ b/init/table_sixteen.ini @@ -108,8 +108,8 @@ table_sixteen= } "rests" = \table { - "1" "\wholerest" -5\pt 1\pt -1\pt 1\pt - "2" "\halfrest" -5\pt 1\pt -1\pt 1\pt + "1" "\wholerest" 0\pt 6\pt 0\pt 2\pt + "2" "\halfrest" 0\pt 6\pt -2\pt 0\pt "4" "\quartrest" -5\pt 2\pt -5\pt 5\pt "8" "\eighthrest" 0\pt 5\pt 0\pt 8\pt "16" "\sixteenthrest" 0\pt 6\pt 0\pt 12\pt diff --git a/input/cadenza.ly b/input/cadenza.ly index 98e1f4ad48..158ee16b14 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -1,13 +1,16 @@ -% title: -% description:Cadenza to Mozart Horn concerto 3 -% composer(s):unknown -% entered-by:HWN -% copyright: public domain -% -% Tested Features: cadenza mode +%{MudelaHeader + title: + description:Cadenza to Mozart Horn concerto 3 + composer(s):unknown + entered-by:HWN + copyright: public domain + Tested Features: cadenza mode -\version "0.0.56"; +EndMudelaHeader +%} + +\version "0.0.57"; cad = \melodic { @@ -18,33 +21,33 @@ cad = \melodic { c'4.\mf g8 - [e'^"accel" ()d' c' b] - [b()c'] g-\fermata + [e'^"accel" ~ d' c' b] + [b~ c'] g-\fermata \bar \empty; c [c_"rubato" e g c'] \octave c''; - e4. e [g ()f_"rit" e d] + e4. e [g ~ f_"rit" e d] \duration 16; - dis4()e4 + dis4~ e4 \bar \empty ; r8 [c d] [e f g gis] \duration 4; - a-> 'f()'e g - f-> 'd()'cis e + a-> 'f~ 'e g + f-> 'd~ 'cis e \duration 8; d4^\fermata \bar \empty ; r8 'a ['b cis] \duration 16; [d cis d e] - f4()[f e d c] + f4~ [f e d c] 'b4 \octave c'; [d'8 c'8 a8]2/3 g2 \bar \empty ; [g c e g] [c' e g c']\octave c''; - [e 'g c e] g4^\fermata %()% BUG! + [e 'g c e] g4^\fermata %~ % BUG! \bar \empty ; [g8.(_"a tempo" e g8. )e] a4. g8 [f8 e8 d8 c8] diff --git a/input/collisions.ly b/input/collisions.ly index a202789ca4..bee5e6de6f 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -1,12 +1,24 @@ -% test the Collision resolution -\version "0.0.56"; +%{MudelaHeader + + filename: collisions.ly + title: + description: + composer(s): HWN + entered-by: HWN + copyright: public domain + + Tested Features:%test the Collision resolution +EndMudelaHeader +%} +\version "0.0.57"; + two_voice_steminvert = \melodic { < \multivoice { \octave c'; \stem 1; - c d e f() g2 g a } + c d e f~ g2 g a } { \stem -1; - g f e g ()g2 g2 } + g f e g ~ g2 g2 } > } @@ -14,9 +26,9 @@ two_voice_steminvert = \melodic { two_voice = \melodic { < \multivoice { \octave c'; \stem -1; - c d e f g2() g a } + c d e f g2~ g a } { \stem 1; - g f e g ()g2 g2 } + g f e g ~ g2 g2 } > } diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index 1fb5e8b0e3..4afddd6614 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -1,16 +1,22 @@ -% Ludwig van Beethoven (1770-1792) -% -% Opus 62 -% Ouverture zu Collins Trauerspiel "Coriolan" -% -% a 5 bar fragment of the alto part -% -% Copyright (c) 1997 Jan Nieuwenhuizen +%{MudelaHeader + + filename: coriolan-alto.ly + title:Ouverture zu Collins Trauerspiel "Coriolan" Opus 62 + description: a 5 bar fragment of the alto part + composer(s): Ludwig van Beethoven (1770-1792) + entered-by: JCN + copyright: public domain + + Tested Features: +EndMudelaHeader +%} + % % when lily can handle this, i-ll type the other 304 bars % (maybe even sooner :-) % -\version "0.0.56"; + +\version "0.0.57"; alto = \melodic{ diff --git a/input/error.ly b/input/error.ly index 4e05238f4c..351ba8725a 100644 --- a/input/error.ly +++ b/input/error.ly @@ -1,4 +1,4 @@ -\version "0.0.56"; +\version "0.0.57"; \include "this-is-hopefully-a-nonexisting-file" @@ -9,7 +9,7 @@ mwa = \melodic{ [ a8 a8 a8 a8 a8 ] % [ a8 ] % % segfault - < { [ bes^"1"( )a bes-. g-. ] a4-.^"4" } { [ e ] } { [ c ] } > | + < { [ bes^"1"~ a bes-. g-. ] a4-.^"4" } { [ e ] } { [ c ] } > | a ) b ] c % warning & % ok; error a b ) ] % ok; error diff --git a/input/header.ly b/input/header.ly index aa80f614bd..af02e8ab9d 100644 --- a/input/header.ly +++ b/input/header.ly @@ -1,11 +1,13 @@ -%%MudelaHeader -% title: -% description: -% composer(s): -% entered-by: -% copyright: -% -% Tested Features: -%%End +%{MudelaHeader -\version "0.0.56"; + filename: + title: + description: + composers: + entered-by: + copyright: + + Tested Features: +EndMudelaHeader +%} +\version "0.0.57"; diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 6765c8f7f0..e9588b6620 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -1,13 +1,20 @@ -% "Ah, vous dirais-je, maman" (Mozart, KV 265) -% -% bare bones version. (written down from memory :-) -% for lyrics, see twinkle.ly +%{MudelaHeader + + filename: kortjakje.ly + title: Ah, vous dirais-je, maman (variations) + description: bare bones version. (written down from memory :-) + composers:Mozart, KV 265 + entered-by: HWN + copyright: none + + Tested Features: example file with comments +EndMudelaHeader +%} +\version "0.0.57"; + % the % is a comment. -% -% copyright: None -% -\version "0.0.56"; + % declare melody (which will be in *one* staff ) for the lead voice melodie = \melodic { @@ -29,8 +36,8 @@ melodie = \melodic { (| % start a slur % NOTE: the slurstart should be directly after the note ) % end a slur. - g r8 g8 (| ) a r8 a8 (| ) g r4 - f r8 f8 (| ) e4 r8 e8 ( |) d4 r8 d8 (| ) c4 r4 + g r8 g8 ~ a r8 a8 ~ g r4 + f r8 f8 ~ e4 r8 e8 ~ | d4 r8 d8 ~ c4 r4 } % more of this. @@ -46,8 +53,8 @@ begeleiding = \melodic{ \octave 'c ; e 'g d 'g c 'g 'b 'g e 'g d 'g c 'g 'b 'g %%%% var 1 - r8 e8() c r8 e8() c r8 f8()c r8 e8()c - r8 d8()'b r8 c8()'a r8 'a8()'f r8 'e8()'c + r8 e8~ c r8 e8~ c r8 f8~ c r8 e8~ c + r8 d8~ 'b r8 c8~ 'a r8 'a8~ 'f r8 'e8~ 'c } \score{ diff --git a/input/pedal.ly b/input/pedal.ly index abebc0fccc..5e760771fe 100644 --- a/input/pedal.ly +++ b/input/pedal.ly @@ -24,7 +24,7 @@ % \lbheel \lbheel \lfheel \lftoe % \rbheel \rbtoe \rfheel \rftoe -\version "0.0.56"; +\version "0.0.57"; \score{ \staff{ melodicregs diff --git a/input/rhythm.ly b/input/rhythm.ly index 2447023f81..8205a45d5b 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -3,7 +3,7 @@ % % add any impressive examples here, please -\version "0.0.56"; +\version "0.0.57"; ritme = \staff { melodicregs @@ -12,7 +12,7 @@ ritme = \staff { \meter 4/4; c8 | - [a8() a8. a8 a16 a16 a16] c4. | % watch the beams! + [a8~ a8. a8 a16 a16 a16] c4. | % watch the beams! r32 r32 r16 r8 r4 r2 | \meter 5/16; diff --git a/input/scales.ly b/input/scales.ly index f819c24026..1a46c21337 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -2,7 +2,7 @@ % scales with accents. % -\version "0.0.56"; +\version "0.0.57"; blah = \staff{ melodicregs \melodic { \meter 6/8; diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 3f8f11436c..7781055764 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -12,7 +12,7 @@ % The purpose of this file is to demonstrate features of LilyPond. % (there is an accompanying LaTeX file, scsii-menuetto.tex) % -\version "0.0.56"; +\version "0.0.57"; %% Stuff from MPP version % \lefttitle{Menuetto} % \tempo{Moderato} @@ -56,40 +56,40 @@ ii_menuetto = \melodic{ < e'2 a2 \f > [ d'( e'16 )f'16 ] | %%10 - < [ e' g > d' cis'_"2" e' a( )g ] | + < [ e' g > d' cis'_"2" e' a~ g ] | %%11 < \multivoice - {\stem 1; a4() d'4 cis'4-. } + {\stem 1; a4~ d'4 cis'4-. } { \stem -1; f2 e4 } > | %%12 - < [ g'^"4" d > f' e' f' d'^"3"( ) c' ] | + < [ g'^"4" d > f' e' f' d'^"3"~ c' ] | %%13 \clef "alto"; < \multivoice { \stem 1; bes2 c'4 } - { \stem -1; g4() f4 e4 }% ugh + { \stem -1; g4~ f4 e4 }% ugh > | %%14 < [ a f > g a f ] < d'4-\upbow e4 'bes4 > | %%15 - < c'4-\downbow f4 'a4 > [ bes( )a g a ] | + < c'4-\downbow f4 'a4 > [ bes~ a g a ] | %%16 [ f( e )f a-. g-. bes-. ] | %%17 < a2^"0" fis2_"3" > bes4 | %%18 - < { [ c'( )bes c' a ] } { [ es ] } > fis4 | + < { [ c'~ bes c' a ] } { [ es ] } > fis4 | %%19 < d'4-\downbow g4 'bes4 > < c'4-\upbow g4 c4 > < [ bes d > a ] | %%20 - < { [ c'( bes a )bes g( )bes ] } { [ d ] } { [ g ] } > | + < { [ c'( bes a )bes g~ bes ] } { [ d ] } { [ g ] } > | %%21 < \multivoice - {\stem 1; d'4(\stem 1; ) cis'4 d'4 } + {\stem 1; d'4 (\stem 1; ) cis'4 d'4 } { \stem -1; g2 f4 } > | %%22 - < { [ g( )f g e ] } { [ cis ] } > < f4 d4 > | + < { [ g~ f g e ] } { [ cis ] } > < f4 d4 > | %%23 [ 'g g ] < e4. 'a4. > d-\upbow | %%24 diff --git a/input/slurs.ly b/input/slurs.ly new file mode 100644 index 0000000000..95de0c7639 --- /dev/null +++ b/input/slurs.ly @@ -0,0 +1,38 @@ +%{MudelaHeader + + filename: slurs.ly + title: + description: + composer(s): HWN + entered-by: HWN + copyright: GPL + + Tested Features: test slurs and ties +EndMudelaHeader +%} + +\version "0.0.57"; + +\score{\staff{ + melodicregs + \melodic{\octave c'; + \duration 4; + c ~ c ~ g ~ c ~ + d ~ e ~ f ~ g ~ + a ~ b ~ 'c ~ c + + < c e ( > <)d f> + \octave c''; + < c e ( > <)d f> + \octave c'; + < c e ( > <)d' f'> + < { c ~ d } + { e ~ f } + > + + + + } + + } +} diff --git a/input/standchen.ly b/input/standchen.ly index 91b21fb94b..78ca3975d1 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -1,15 +1,17 @@ -% standchen.ly -% -% St\"andchen (Serenade) "Leise flehen meine Lieder" D.957 No.4 -% Franz Schubert (1797-1828) -% Text by Ludwig Rellstab (1799-1860) -% -% Copyright (c) 1995,1996,1997 Jan Nieuwenhuizen -% -% The purpose of this file is to demonstrate features of LilyPond. -% (there is an accompanying LaTeX file, standchen.tex) -% -\version "0.0.56"; +%{ +standchen.ly + + St\"andchen (Serenade) "Leise flehen meine Lieder" D.957 No.4 + Franz Schubert (1797-1828) + Text by Ludwig Rellstab (1799-1860) + + Copyright (c) 1995,1996,1997 Jan Nieuwenhuizen + + The purpose of this file is to demonstrate features of LilyPond. + (there is an accompanying LaTeX file, standchen.tex) + +%} +\version "0.0.57"; commands = \melodic{ \skip 2.*4; @@ -40,30 +42,30 @@ melodie = \melodic{ %%4 r < [ 'a cis > e < 'a cis > e < 'a cis ] > | %%5 - [ a()bes a ]2/3 d'4. a | + [ a~ bes a ]2/3 d'4. a | %%6 - [ g()a g ]2/3 d'4 g r | + [ g~ a g ]2/3 d'4 g r | %%7 - a4.^> g [ g()f e ]2/3 | + a4.^> g [ g~ f e ]2/3 | %%8 f2 r4 | %%9 - < { a'4.( )g' [ g'( f' )e' ]2/3 } + < { a'4.~ g' [ g'( f' )e' ]2/3 } { cis'4. e'_"dolce" \plet 2/3; e' \plet 1/1; } > | %%10 < f'2. d'2. > | %%11 - [ a (\pp )bes a ]2/3 f'4. a | + [ a ~ bes a ]2/3 f'4. a | %%12 - [ g( ) a g ]2/3 e'4. d' | + [ g~ a g ]2/3 e'4. d' | %%13 - c'4. bes [ bes( ) a g ]2/3 | + c'4. bes [ bes~ a g ]2/3 | %%14 a2 r - < { d'( | )c'4. g [ bes a g ]2/3 } - { f \p ( | )e4._"dolce" bes + < { d'~ c'4. g [ bes a g ]2/3 } + { f \p ~ e4._"dolce" bes \plet 2/3; g \plet 1/1; } > | @@ -77,12 +79,12 @@ melodie = \melodic{ [ d'8. a16 ] f4. d | %%19 %#% c'\grace\stemup - [ bes (\pp ) a bes ]2/3 d'4. bes | + [ bes ~ a bes ]2/3 d'4. bes | %%20 a2. | %%21 %#% a\grace - [ g( )fis g ]2/3 bes4.^> g | + [ g~ fis g ]2/3 bes4.^> g | %%22 f!2. | %%23 @@ -90,16 +92,16 @@ melodie = \melodic{ %%24 [ d'8. a16 ] fis4. d | %%25 - [ b \mf( ) ais b ]2/3 d'4. b | + [ b \mf~ ais b ]2/3 d'4. b | %%26 < a2. fis2. > | %%27 - [ e' \f( )dis' e' ]2/3 g'4. cis' | + [ e' \f~ dis' e' ]2/3 g'4. cis' | %%28 < d'2. fis2. > | %#%\volta1 %%29 - < { bes2( [ d'8.( ))g16 ] } + < { bes2( [ d'8.~ )g16 ] } { g2 \mf [ bes8. bes16 ] } > | %%30 < { a4. [ a-. a-. a-. ] } @@ -110,7 +112,7 @@ melodie = \melodic{ %%32 < a2 fis2 \pp > < a4 fis4 > | %%33 - < { b2( [ d'8.( ) )g16 ] } + < { b2( [ d'8.~ g16 ] } { g2 [ b8. b16 ] } > | %%34 < { a4. [ a-. a-. a-. ] } @@ -124,14 +126,14 @@ melodie = \melodic{ %%37 [ a8. a16 ] [ cis'8. cis'16 ] [ e'8. e'16 ] | %%38 - d'4( )cis'4 r4 | + d'4~ cis'4 r4 | %%39 %#% > a4. [ cis' e'8. >! d'16 ] | a4. \> [ cis' e'8. \! d'16 ] | %%40 cis'2 r4 | %%41 - < fis'4. \> cis'4. \f > e' [ e'( )d' \! cis' ]2/3 | + < fis'4. \> cis'4. \f > e' [ e'~ d' \! cis' ]2/3 | %%42 [ b8. cis'16 ] d'4^> b r | %%43 @@ -140,16 +142,16 @@ melodie = \melodic{ %%44 [ b8. \> cis'16 ] d'4^> b \! r | %%45 - [ b \p ( )ais b ]2/3 d'4. b | + [ b \p ~ ais b ]2/3 d'4. b | %%46 | %%47 - [ e' \f( )dis' e' ]2/3 g'4.^> cis' | + [ e' \f~ dis' e' ]2/3 g'4.^> cis' | %%48 \textstyle "italic"; < - { fis2.( \group "+1"; \stem -1; )f2. } - { d'2. ( \stem 1; )d'4 r4_"decresc." d'4 } + { fis2.~ \group "+1"; \stem -1; f2. } + { d'2. ~ \stem 1; d'4 r4_"decresc." d'4 } > \textstyle "roman"; | %%50 diff --git a/input/toccata-fuga-E.ly b/input/toccata-fuga-E.ly index 0220b0f89d..4cdeb0a2f2 100644 --- a/input/toccata-fuga-E.ly +++ b/input/toccata-fuga-E.ly @@ -13,7 +13,7 @@ % * organ staff... % -\version "0.0.56"; +\version "0.0.57"; toccata_commands = \melodic{ \meter 4/4; @@ -26,8 +26,8 @@ toccata_right = \melodic{ % 13 -- how to type -- where to split -- this more neatly ? \octave c'; <\multivoice - { \stem 1; \hshift 1; r4 dis'4 e'4.-. e'8( | )e'4 [d'8 fis'8] gis'4 [gis'8 fis'16 e'16] | fis'4( )[fis'8 e'16 dis'16] e'4 r8 e'8 } - { \stem 1; r4 bis4 cis'4-. cis'4 | ais'4( )[ais'16 gis'16 ais'16 b'16] dis'4 cis'4( | )[cis'8 dis'16 ais16] bis4 cis'4 r8 b8 } + { \stem 1; \hshift 1; r4 dis'4 e'4.-. e'8~ e'4 [d'8 fis'8] gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 } + { \stem 1; r4 bis4 cis'4-. cis'4 | ais'4~ [ais'16 gis'16 ais'16 b'16] dis'4 cis'4~ [cis'8 dis'16 ais16] bis4 cis'4 r8 b8 } { \stem -1; r4 < gis4 fis4 dis4 > gis4-. gis4 | ais4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 } > | % 16 @@ -39,8 +39,8 @@ toccata_left = \melodic{ \clef bass; % 13 <\multivoice - { \stem 1; bis2 cis'4-. cis'4( | )[cis'8 ais'8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 } - { \stem 1; \hshift 1; r4 gis4. gis8( )gis4 | \stem -1; \hshift 0; ais4. fis8 gis4. ais8( | )ais4 gis4-. gis4 r8 gis8 } + { \stem 1; bis2 cis'4-. cis'4~ [cis'8 ais'8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 } + { \stem 1; \hshift 1; r4 gis4. gis8~ gis4 | \stem -1; \hshift 0; ais4. fis8 gis4. ais8~ ais4 gis4-. gis4 r8 gis8 } { \stem -1; r4 < dis4 fis4 > < cis4 e4 > } > | % 16 @@ -80,9 +80,9 @@ fuga2_right = \melodic{ > | % 16 <\multivoice - { \stem 1; dis'2 dis'4 | cis'2 cis'4 | b4( )[b8 cis'8 dis'8 e'8] } - { \stem 1; \hshift 1; b8 fis8 b2( | )[b8 a16 g16] a2 | a4 gis2 } - { \stem -1; fis2.( | )fis2.( | )fis4 e2 } + { \stem 1; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] } + { \stem 1; \hshift 1; b8 fis8 b2~ [b8 a16 g16] a2 | a4 gis2 } + { \stem -1; fis2.~ fis2.~ fis4 e2 } > | % 19 } diff --git a/input/twinkle.ly b/input/twinkle.ly index 26795ef17a..df4cf9a0cd 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -1,11 +1,20 @@ -% "Ah, vous dirais-je, maman" -% "Altijd is Kortjakje ziek" -% "Twinkle twinkle little star" -% -% Copyright: none -\version "0.0.56"; - -\version "0.0.55"; +%{MudelaHeader + + filename: twinkle.ly + title: twinkle twinkle little star + description: + "Ah, vous dirais-je, maman" + "Altijd is Kortjakje ziek" + "Twinkle twinkle little star" + + composers: ? + entered-by: HWN & JCN + copyright: public domain + + Tested Features: lyrics +EndMudelaHeader +%} +\version "0.0.57"; melody = \melodic{ \clef\violin; diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 7d5a7d72b8..291ef663b4 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -1,14 +1,14 @@ -% -% title: Das Wohltemperirte Clavier I, Fuga II (c-minor) -% description: -% composer(s): JS Bach -% entered-by: HWN -% copyright:Public Domain -% -% Tested Features:stem direction, multivoice. -% +%{ + title: Das Wohltemperirte Clavier I, Fuga II (c-minor) + description: + composer(s): JS Bach + entered-by: HWN + copyright:Public Domain -\version "0.0.56"; + Tested Features:stem direction, multivoice. +%} + +\version "0.0.57"; global = \melodic{ \meter 4/4 ; @@ -26,7 +26,7 @@ dux = \melodic { [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] | [es c' b a] [ g f es d] [c8 es' d' c'] | [bes a bes c'] [fis g a fis] | - g4 r16 [c d es] [f g as8(] [)as16 d es f ]| + g4 r16 [c d es] [f g as8~] [as16 d es f ]| [g a bes8(] [)bes16 es f g ] [as g f es] [d8 c'16 b]| c'4 r4 r8 [f' es' d'] r8 [as g f] [g f16 es] [f8 d] | @@ -50,12 +50,12 @@ dux = \melodic { [es d es f] [B c d B] | c4 r8 e8 [f f16 e] [f8 c] | d4 r8 d8 [es8 es16 d] [es8 Bes] | - c2 () [c8 d16 es][ f es f d] | + c2 ~ [c8 d16 es][ f es f d] | B8 r8 r B c r r es | - d r r f()f r r f | + d r r f~ f r r f | [es as g f] [es d es f] | [B c d B] [B c] r c | - [f16 d es c]()[c8 B] c4 r8 e | + [f16 d es c]~ [c8 B] c4 r8 e | f4 r8 [f es16 d] [es8 | r r | } @@ -122,7 +122,7 @@ bassdux = \melodic { r [es d c] [d c16 Bes] [c8 d] | [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] | [f d'16 c'] [d'8 fis] g4 r16 [G A B] | - [c16 d es8]()[es16 A Bes c] [d es f8]()[f16 'b c d]| + [c16 d es8]~ [es16 A Bes c] [d es f8]~ [f16 'b c d]| %%20 es8 r r e [f F Es D] | r [As G F] [G F16 Es] [F8 G] | @@ -135,8 +135,8 @@ bassdux = \melodic { [F16 G] As4 [G16 F] Es4 r8 es | [d c g G] < \multivoice - { \stem 1; c2 (|)c1(|) c1 } - { \stem -1; C2(|)C1(|) C1 } + { \stem 1; c2 ~ |c1~ | c1 } + { \stem -1; C2~ |C1~ | C1 } > } diff --git a/lily/.version b/lily/.version index 04ee1d9883..81bb5a3ffc 100644 --- a/lily/.version +++ b/lily/.version @@ -1,8 +1,8 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 58 +PATCH_LEVEL = 59 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf -MY_PATCH_LEVEL = .jcn3 +MY_PATCH_LEVEL = diff --git a/lily/bow.cc b/lily/bow.cc new file mode 100644 index 0000000000..5e463408e1 --- /dev/null +++ b/lily/bow.cc @@ -0,0 +1,56 @@ +/* + bow.cc -- implement Bow + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "bow.hh" +#include "paper-def.hh" +#include "lookup.hh" + +Bow::Bow() +{ + left_pos_i_ = right_pos_i_ = 0; + left_dx_f_ = right_dx_f_ = 0.0; +} + + +Offset +Bow::center() const +{ + int dy = right_pos_i_-left_pos_i_; + + Real w = width().length(); + + return Offset(w/2,dy * paper()->internote()); +} + +Molecule* +Bow::brew_molecule_p() const +{ + Molecule*output = new Molecule; + Real w = width().length(); + + int dy = right_pos_i_ - left_pos_i_; + + Real nw_f = paper()->note_width(); + Real nh_f = paper()->internote(); + + + w+= (right_dx_f_ - left_dx_f_) * nw_f ; + Real round_w = w; // slur lookup rounds the slurwidth . + + Symbol sl = paper()->lookup_l()->slur(dy , round_w, dir_i_); + + Real error = w-round_w; + + Atom a(sl); + a.translate(Offset((left_dx_f_ + 0.5 )*nw_f + error/2, + left_pos_i_ * nh_f)); + output->add(a); + return output; +} + +IMPLEMENT_STATIC_NAME(Bow); diff --git a/lily/directional-spanner.cc b/lily/directional-spanner.cc index 7e2bb7c878..0c48c80f6e 100644 --- a/lily/directional-spanner.cc +++ b/lily/directional-spanner.cc @@ -1,5 +1,10 @@ #include "directional-spanner.hh" +void +Directional_spanner::set_default_dir() +{ + dir_i_ = -1; +} Directional_spanner::Directional_spanner() { dir_i_ = 0; diff --git a/lily/include/bow.hh b/lily/include/bow.hh new file mode 100644 index 0000000000..ab3908a769 --- /dev/null +++ b/lily/include/bow.hh @@ -0,0 +1,29 @@ +/* + bow.hh -- declare Bow + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef BOW_HH +#define BOW_HH +#include "directional-spanner.hh" + +/** + base class for anything that looks like a slur. + */ +class Bow : public Directional_spanner { +protected: + int left_pos_i_; + int right_pos_i_; + Real left_dx_f_; + Real right_dx_f_; + Molecule*brew_molecule_p()const; +public: + Bow(); + NAME_MEMBERS(Bow); + Offset center() const; +}; +#endif // BOW_HH diff --git a/lily/include/directional-spanner.hh b/lily/include/directional-spanner.hh index 9399b71c4d..049f28b17b 100644 --- a/lily/include/directional-spanner.hh +++ b/lily/include/directional-spanner.hh @@ -17,7 +17,7 @@ struct Directional_spanner : Spanner{ /// offset of "center" relative to left-column/0-pos of staff virtual Offset center() const=0; - virtual void set_default_dir()=0; + virtual void set_default_dir(); Directional_spanner(); }; diff --git a/lily/include/item.hh b/lily/include/item.hh index cae928961f..622f0f0dea 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -1,3 +1,10 @@ +/* + item.hh -- declare Item + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ #ifndef ITEM_HH #define ITEM_HH @@ -27,6 +34,14 @@ public: void do_print()const; Real hpos_f() const; NAME_MEMBERS(Item); + /** + + @return the line where this is in; + + PRE + Breaking calc has to be finished + */ + Line_of_score * line_l() const; }; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 8239946370..d40e1616e6 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -55,6 +55,9 @@ struct Span_req; struct Span_dynamic_req; struct Subtle_req; struct Stem_req; +struct Tie_req; +struct Tie; +struct Tie_register; struct Terminate_voice_req; struct Text_req; struct Timing_req; diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 029579056d..eaba302d2b 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -10,6 +10,7 @@ #ifndef MUSICALREQUESTS_HH #define MUSICALREQUESTS_HH +#include "lily-proto.hh" #include "request.hh" #include "duration.hh" @@ -24,6 +25,7 @@ public: virtual Skip_req* skip() { return 0; } 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); @@ -191,6 +193,14 @@ public: Beam_req(); }; +/** + Start a tie at this voice element, end it at the next + */ +class Tie_req : public Musical_req { +public: + REQUESTMETHODS(Tie_req, tie); +}; + /// a slur class Slur_req : public Span_req { public: diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index ba118fcbde..b5af018528 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -15,10 +15,11 @@ /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts ) as a single entity. */ class Note_column : public Script_column { - /// link to the stem. For setting default direction - Stem * stem_l_; void do_pre_processing(); public: + /// link to the stem. For setting default direction + Stem * stem_l_; + bool h_shift_b_; Array head_l_arr_; diff --git a/lily/include/slur-reg.hh b/lily/include/slur-reg.hh index f53ed992b3..e9a27a43d6 100644 --- a/lily/include/slur-reg.hh +++ b/lily/include/slur-reg.hh @@ -20,6 +20,7 @@ class Slur_register :public Request_register { protected: virtual ~Slur_register(); virtual bool try_request(Request*); + virtual bool acceptable_request_b(Request*); virtual void process_requests(); virtual void acknowledge_element(Staff_elem_info); virtual void pre_move_processing(); diff --git a/lily/include/slur.hh b/lily/include/slur.hh index c8363075c4..68f073e10f 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -8,26 +8,21 @@ #define SLUR_HH #include "directional-spanner.hh" -#include "fproto.hh" +#include "lily-proto.hh" #include "varray.hh" +#include "bow.hh" -struct Slur : Directional_spanner { +class Slur : public Bow { +public: + Array encompass_arr_; - Array encompass; - - bool open_left, open_right; - - /* *************** */ - Offset center() const; - Slur(); void do_post_processing(); void do_pre_processing(); - void add(Notehead*); + void add(Note_column*); void set_default_dir(); Spanner* do_break_at( PCol*, PCol*) const; private: - Molecule*brew_molecule_p()const; NAME_MEMBERS(Slur); }; diff --git a/lily/include/tie-reg.hh b/lily/include/tie-reg.hh new file mode 100644 index 0000000000..34387c964d --- /dev/null +++ b/lily/include/tie-reg.hh @@ -0,0 +1,34 @@ +/* + tie-reg.hh -- declare Tie_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef TIE_REG_HH +#define TIE_REG_HH + +#include "register.hh" + +class Tie_register : public Request_register { + Tie * end_tie_p_; + Tie * tie_p_; + Moment end_mom_; + Tie_req * req_l_; + Tie_req *end_req_l_; +protected: + virtual ~Tie_register(); + virtual void acknowledge_element(Staff_elem_info); + virtual bool try_request(Request*); + virtual bool acceptable_request_b(Request*); + virtual void process_requests(); + virtual void post_move_processing(); + virtual void pre_move_processing(); +public: + Tie_register(); + NAME_MEMBERS(Tie_register); +}; + +#endif // TIE_REG_HH diff --git a/lily/include/tie.hh b/lily/include/tie.hh new file mode 100644 index 0000000000..9247b26156 --- /dev/null +++ b/lily/include/tie.hh @@ -0,0 +1,27 @@ +/* + tie.hh -- declare Tie + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef TIE_HH +#define TIE_HH + +#include "bow.hh" + +class Tie : public Bow { + virtual Spanner* do_break_at(PCol*,PCol*)const; + virtual void do_add_processing(); + virtual void do_post_processing(); +public: + Notehead * left_head_l_; + Notehead * right_head_l_; + + void set_head(int, Notehead*head_l); + Tie(); + +}; +#endif // TIE_HH diff --git a/lily/item.cc b/lily/item.cc index e35ab29446..e586547d80 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -31,3 +31,9 @@ Item::hpos_f()const { return pcol_l_->hpos + offset().x; } + +Line_of_score * +Item::line_l()const +{ + return pcol_l_->line_l_; +} diff --git a/lily/musical-request.cc b/lily/musical-request.cc index e9793572e7..5ed08aa996 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -33,6 +33,8 @@ Stem_req::Stem_req() IMPLEMENT_STATIC_NAME(Musical_req); void Musical_req::do_print()const{} +void +Tie_req::do_print()const{} IMPLEMENT_STATIC_NAME(Request); @@ -435,3 +437,5 @@ Span_dynamic_req::do_print()const mtor << "louder/louder: " <dir_i_; + if (!dir_i_){ + if (stem_l_) + dir_i_ = stem_l_->dir_i_; + else + dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1; + } } diff --git a/lily/p-score.cc b/lily/p-score.cc index 6f1b362765..37090b77db 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -253,10 +253,10 @@ PScore::process() { clean_cols(); print(); - *mlog << "Preprocessing ... " < -#define MUDELA_VERSION "0.0.56" +#define MUDELA_VERSION "0.0.57" #include "script-def.hh" #include "symtable.hh" @@ -807,7 +807,10 @@ close_plet_parens: ; close_request_parens: - '(' { + '~' { + $$ = '~'; + } + | '(' { $$='('; } | ']' { diff --git a/lily/score.cc b/lily/score.cc index 30514a7c5f..7441d5c790 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -26,7 +26,7 @@ extern String default_out_fn; void Score::setup_music() { - *mlog << "\nSetting up music ..." << flush; + *mlog << "\nSetting up requests..." << flush; Pulk_voices pulk(staffs_); @@ -60,7 +60,7 @@ Score::setup_music() void Score::process_music() { - *mlog << "Processing music ..." << flush; + *mlog << "Processing requests ..." << flush; for (Score_walker w(this); w.ok(); w++) { w.process(); } diff --git a/lily/slur-reg.cc b/lily/slur-reg.cc index 9498dd4c7c..a9acf3b67b 100644 --- a/lily/slur-reg.cc +++ b/lily/slur-reg.cc @@ -11,7 +11,13 @@ #include "slur-reg.hh" #include "slur.hh" #include "debug.hh" -#include "notehead.hh" +#include "note-column.hh" + +bool +Slur_register::acceptable_request_b(Request*req_l) +{ + return req_l->musical() && req_l->musical()->slur(); +} bool Slur_register::try_request(Request *req_l) @@ -26,12 +32,12 @@ Slur_register::try_request(Request *req_l) void Slur_register::acknowledge_element(Staff_elem_info info) { - if (info.elem_l_->name() == Notehead::static_name()) { - Notehead *head_p =(Notehead*) info.elem_l_ ;// ugh + if (info.elem_l_->name() == Note_column::static_name()) { + Note_column *col_l =(Note_column*) info.elem_l_ ;// ugh for (int i = 0; i < slur_l_stack_.size(); i++) - slur_l_stack_[i]->add(head_p ); + slur_l_stack_[i]->add(col_l ); for (int i = 0; i < end_slur_l_arr_.size(); i++) - end_slur_l_arr_[i]->add(head_p); + end_slur_l_arr_[i]->add(col_l); } } /* diff --git a/lily/slur.cc b/lily/slur.cc index 6bc5c1b24b..a47679a3f4 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -1,3 +1,11 @@ +/* + slur.cc -- implement Slur + + source file of the LilyPond music typesetter + + (c) 1996, 1997 Han-Wen Nienhuys +*/ + /* TODO: @@ -10,7 +18,8 @@ #include "scalar.hh" #include "lookup.hh" #include "paper-def.hh" -#include "notehead.hh" +#include "note-column.hh" +#include "stem.hh" #include "p-col.hh" #include "molecule.hh" #include "debug.hh" @@ -18,52 +27,30 @@ -Slur::Slur() -{ - open_right=open_left=false; -} - -Offset -Slur::center() const -{ - int pos1 = encompass.top()->position_i_; - int pos2 = encompass[0]->position_i_; - - int dy = pos1-pos2; - - Real w = width().length(); - - return Offset(w/2,dy * paper()->internote()); -} - void -Slur::add(Notehead*n) +Slur::add(Note_column*n) { - encompass.push(n); + encompass_arr_.push(n); add_dependency(n); } void Slur::set_default_dir() { - int sumpos=0; - for (int i=0; i < encompass.size(); i ++) { - sumpos += encompass[i]->position_i_; + dir_i_ = -1; + for (int i=0; i < encompass_arr_.size(); i ++) { + if (encompass_arr_[i]->dir_i_ < 0) { + dir_i_ =1; + break; + } } - - /* should consult stems */ - Real meanpos = sumpos/Real(encompass.size()); - if (meanpos < 5) // todo - dir_i_ = -1; - else - dir_i_ = 1; } void Slur::do_pre_processing() { - right_col_l_ = encompass.top()->pcol_l_; - left_col_l_ = encompass[0]->pcol_l_; + right_col_l_ = encompass_arr_.top()->pcol_l_; + left_col_l_ = encompass_arr_[0]->pcol_l_; } Spanner* @@ -72,16 +59,11 @@ Slur::do_break_at(PCol*l, PCol*r) const assert(l->line_l_ == r->line_l_); Slur*ret = new Slur(*this); - ret->encompass.set_size(0); - for (int i =0; i < encompass.size(); i++) { - if (encompass[i]->pcol_l_->line_l_==l->line_l_) - ret->encompass.push(encompass[i]); + ret->encompass_arr_.set_size(0); + for (int i =0; i < encompass_arr_.size(); i++) { + if (encompass_arr_[i]->pcol_l_->line_l_==l->line_l_) + ret->encompass_arr_.push(encompass_arr_[i]); } - if (right_col_l_ != r) - ret->open_right = true; - if (left_col_l_ != l) - ret->open_left = true; - return ret; } @@ -91,49 +73,8 @@ Slur::do_post_processing() { if (!dir_i_) set_default_dir(); + Real inter_f = paper()->internote(); + left_pos_i_ = encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f; + right_pos_i_ = encompass_arr_.top()->stem_l_->height()[dir_i_]/inter_f; } - -Molecule* -Slur::brew_molecule_p() const -{ - Molecule*output = new Molecule; - - int minp=1000, maxp=-1000; // todo - for (int i=0; iposition_i_ position_i_ >? maxp; - } - assert(encompass.size()>0); // todo - - Notehead *lnote_p =encompass[0]; - Notehead *rnote_p =encompass.top(); - int lpos_i = lnote_p->position_i_; - int rpos_i = rnote_p->position_i_; - Offset left_off(lnote_p->x_dir_i_, lpos_i + 2*dir_i_); - Offset right_off(lnote_p->x_dir_i_, rpos_i + 2*dir_i_); - if (!lnote_p->extremal_i_) - left_off += Offset(0.5, -dir_i_); - if (!rnote_p->extremal_i_) - right_off+= Offset(-0.5, -dir_i_); - - int dy = int(right_off.y - left_off.y); - - Real nw_f = paper()->note_width(); - Real nh_f = paper()->internote(); - Real w = width().length(); - - w+= (right_off.x - left_off.x) * nw_f ; - Real round_w = w; // slur lookup rounds the slurwidth . - - Symbol sl = paper()->lookup_l()->slur(dy , round_w, dir_i_); - - Real error = w-round_w; - - Atom a(sl); - a.translate(Offset((left_off.x + 0.5 )*nw_f + error/2, - left_off.y * nh_f)); - output->add(a); - return output; -} - IMPLEMENT_STATIC_NAME(Slur); diff --git a/lily/spanner.cc b/lily/spanner.cc index c640b2927e..2df030dd5b 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -24,6 +24,7 @@ Spanner::broken_at(PCol*c1, PCol *c2)const span_p->left_col_l_ = c1; span_p->right_col_l_ = c2; + span_p->pstaff_l_ = pstaff_l_; return span_p; } diff --git a/lily/stem.cc b/lily/stem.cc index a14ce880f9..da00ece26e 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -131,7 +131,7 @@ Stem::set_default_stemlen() // ugh... how about non 5-line staffs? if ((max_head_i() < -2 && dir_i_ == 1 ) ||(min_head_i() > staff_size_i_ && dir_i_ == -1) ){ - set_stemend( staff_size_i_ /2 ); + set_stemend( staff_size_i_ /2 -1 ); } else { set_stemend( (dir_i_ > 0) ? max_head_i() + STEMLEN : min_head_i() - STEMLEN); diff --git a/lily/tie-reg.cc b/lily/tie-reg.cc new file mode 100644 index 0000000000..fd2df29a86 --- /dev/null +++ b/lily/tie-reg.cc @@ -0,0 +1,97 @@ +/* + tie-reg.cc -- implement Tie_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "tie-reg.hh" +#include "tie.hh" +#include "notehead.hh" +#include "musical-request.hh" +#include "voice-element.hh" + +Tie_register::Tie_register() +{ + end_tie_p_ = 0; + tie_p_ = 0; + req_l_ =0; + end_req_l_ =0; + end_mom_ = -1; +} + +void +Tie_register::post_move_processing() +{ + if (tie_p_ && get_staff_info().when() == end_mom_) { + end_tie_p_ = tie_p_; + end_req_l_ = req_l_; + tie_p_ =0; + req_l_ =0; + end_mom_ = -1; + } +} + +bool +Tie_register::acceptable_request_b(Request*r) +{ + return r->musical() && r->musical()->tie(); +} + +bool +Tie_register::try_request(Request*r) +{ + if(!acceptable_request_b(r)) + return false; + if (req_l_ ) { + return false; + } + req_l_ = r->musical()->tie(); + end_mom_ = r->elt_l_->duration_ + get_staff_info().when(); + return true; +} + +void +Tie_register::process_requests() +{ + if (req_l_ && ! tie_p_) { + tie_p_ = new Tie; + } +} + +void +Tie_register::acknowledge_element(Staff_elem_info i) +{ + if (i.elem_l_->name() == Notehead::static_name()) { + if (tie_p_) + tie_p_->set_head(-1, (Notehead*)i.elem_l_); + + if (end_tie_p_) { + end_tie_p_->set_head(1, (Notehead*)i.elem_l_); + announce_element(Staff_elem_info(end_tie_p_,end_req_l_)); + } + } +} + +void +Tie_register::pre_move_processing() +{ + if (end_tie_p_) { + typeset_element(end_tie_p_); + end_tie_p_ =0; + end_req_l_ =0; + } + +} + +Tie_register::~Tie_register() +{ + if (tie_p_) { + req_l_->warning("unended Tie"); + delete tie_p_; + } +} + +IMPLEMENT_STATIC_NAME(Tie_register); +ADD_THIS_REGISTER(Tie_register); diff --git a/lily/tie.cc b/lily/tie.cc new file mode 100644 index 0000000000..eff99f4600 --- /dev/null +++ b/lily/tie.cc @@ -0,0 +1,63 @@ +/* + tie.cc -- implement Tie + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "tie.hh" +#include "notehead.hh" +#include "p-col.hh" + +Spanner* +Tie::do_break_at(PCol*l, PCol*r) const +{ + Tie * tie_p = new Tie; + Line_of_score const *line_C=l->line_l_; + if (left_head_l_->line_l()== line_C) + tie_p->left_head_l_ = left_head_l_; + if (right_head_l_->line_l() == line_C) + tie_p->right_head_l_ = right_head_l_; + + return tie_p; +} + +void +Tie::set_head(int x_pos, Notehead * head_l) +{ + if (x_pos >0) { + assert(!right_head_l_); + right_head_l_ = head_l; + } else { + assert(!left_head_l_); + left_head_l_ = head_l; + } + add_dependency(head_l); +} + +Tie::Tie() +{ + right_head_l_ =0; + left_head_l_ =0; +} + +void +Tie::do_add_processing() +{ + assert(left_head_l_ && right_head_l_); + left_col_l_ = left_head_l_ -> pcol_l_; + right_col_l_ = right_head_l_ -> pcol_l_; +} + +void +Tie::do_post_processing() +{ + assert(left_head_l_ || right_head_l_); + left_pos_i_ = (left_head_l_)? + left_head_l_->position_i_ : right_head_l_->position_i_; + right_pos_i_ = (right_head_l_) ? + right_head_l_->position_i_ : left_head_l_->position_i_; +} + + diff --git a/make/lilypond.lsm b/make/lilypond.lsm index 2c3dc12e90..7c675336f2 100644 --- a/make/lilypond.lsm +++ b/make/lilypond.lsm @@ -2,8 +2,8 @@ Begin3 Title: LilyPond -Version: 0.0.58 -Entered-date: 05/02/97 +Version: 0.0.59 +Entered-date: 05/05/97 Description: LilyPond is a program which converts a music-script (mudela) into TeX output, or MIDI to produce multi-staff scores. Features include multiple meters, clefs, keys, lyrics, versatile input-language, cadenzas @@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: pcnov095.win.tue.nl /pub/lilypond/ - 300k lilypond-0.0.58.tar.gz + 300k lilypond-0.0.59.tar.gz Alternate-site: Original-site: Platform: unix/win32, GNU C++ diff --git a/make/lilypond.spec b/make/lilypond.spec index 9b43308086..4fa3667bc0 100644 --- a/make/lilypond.spec +++ b/make/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 0.0.58 +Version: 0.0.59 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.58.tar.gz +Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.59.tar.gz Summary: A preprocessor to make TeX typeset music. URL: http://www.stack.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys @@ -25,7 +25,7 @@ make all strip bin/lilypond bin/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/examples.text Documentation/out/faq.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/kortjakje.ly input/rhythm.ly input/scales.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/standchen.ly input/standchen.tex 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/examples.text Documentation/out/faq.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/kortjakje.ly input/pedal.ly input/rhythm.ly input/scales.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 /usr/bin/convert-mudela /usr/bin/lilypond /usr/lib/libflower.so diff --git a/tex/dimen.tex b/tex/dimen.tex index 9d36059462..4ae5e1376c 100644 --- a/tex/dimen.tex +++ b/tex/dimen.tex @@ -1,4 +1,4 @@ -\font\musicfont=cmsy10 +\font\musicfont=musix16 \font\slurfont=xslu16 \def\thefont{\musicfont} -- 2.39.2