From: fred Date: Tue, 26 Mar 2002 21:44:41 +0000 (+0000) Subject: lilypond-1.1.9 X-Git-Tag: release/1.5.59~2714 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a33a379bbc9d160d89d6aecf6ebac5cf9d4d0438;p=lilypond.git lilypond-1.1.9 --- diff --git a/Documentation/footer.html.in b/Documentation/footer.html.in new file mode 100644 index 0000000000..4f0a023856 --- /dev/null +++ b/Documentation/footer.html.in @@ -0,0 +1,27 @@ + + + +
+Return to %s's home page. +

+Please send GNU LilyPond questions and comments to + + +gnu-music-discuss@gnu.org. +

+ +Please send comments on these web pages to + +%s, +send other FSF & GNU inquiries and questions to + +gnu@gnu.org.

+

+ + +Copyright (c) 1997, 1998 Han-Wen Nienhuys and Jan Nieuwenhuizen. +

+Verbatim copying and distribution of this entire article is +permitted in any medium, provided this notice is preserved.

+ diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index 7a2e4ec17a..574362f31b 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -15,6 +15,12 @@ TODO: the explanation of how lyrics mode parses words seems ridiculous. Is there a simple way to explain this, or is the behavior too complicated for a reasonable explanation? + \relative and \tranpose and \times make it necessary to specify + an explicit \type staff, or bizarre things happen. + catalan.ly + accordion symbols + extender* (see extender.ly) + \repeat & \alternative -> probably should have an example ) @@ -40,7 +46,7 @@ latexlayoutcmds( whentexinfo(notableofcontents()) -article(Mudela 1.0.7 / LilyPond 1.0.15 Reference Manual) +article(Mudela 1.0.7 / LilyPond 1.1.8 Reference Manual) (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen) (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop()) @@ -113,6 +119,11 @@ file(init.)var(ext) and process this file. The file file(init.)var(ext) must contain the code(\maininput) keyword or LilyPond will not read the user specified file. +When LilyPond processes file(filename.ly) it will produce file(filename.tex) as +output. If file(filename.ly) contains a second code(\paper) keyword, then +LilyPond will produce file(filename-1.tex) as well. Subsequent code(\paper) +keywords will produces sequentially numbered file names. Several files can be +specified; they will each be processed independently. sect(Syntax) @@ -213,16 +224,16 @@ will only be able to refer to identifiers whose names begin with a letter and are entirely alphanumeric. It is also impossible to refer to an identifier whose name is the same as the name of a keyword. The following words are keywords: -verb(absdynamic header musicalpitch remove times -accepts in name score translator -bar include notenames script transpose -cadenza key notes shape type -clef keysignature paper skip version -cm lyrics partial spandynamic -consists maininput penalty symboltables -duration mark property table -font midi pt tempo -grouping mm relative time) +verb(absdynamic grouping mm relative symboltables +accepts header musicalpitch remove table +alternative in name repeat tempo +bar include notenames scm time +cadenza key notes scmfile times +clef keysignature paper score translator +cm lyrics partial script transpose +consists maininput penalty shape type +duration mark property skip version +font midi pt spandynamic) The right hand side of an identifier assignment is parsed completely when the assignment is made. It therefore must have any context @@ -332,6 +343,11 @@ Leise DOEXPAND(Fl\)DOEXPAND("u\)ss{}teren meine Sapfe % 4 words _ _ _ _ % 4 words, each one a space )) +It is possible to create words that break the rules by prefixing them with the +dollar sign code($). Regardless of the context, a word beginning with code($) +extends until the next white space character. Such words can contain numbers +(even in Note mode), or other forbidden characters. The dollar sign can be +used to create and access identifiers that could not otherwise be used. COMMENT( These modes are of a lexical nature. Normal and Note mode largely @@ -454,6 +470,10 @@ code([) and code(]). mudela(fragment,verbatim,center)( [a'8 a'] [a'16 a' a' a'] ) +If you want to put beams over chords, you will find that the obvious +construction does not work. You must do the following: +mudela(fragment,verbatim,center)(<[a'8 c''> b' ) +The bracket characters must appear immediately adjacent to a note. In order to create triplets, you must use a length multiplier after the brackets. An open bracket code([) followed by a fraction @@ -529,13 +549,13 @@ mudela()( c''-\open c''-\flageolet c''-\reverseturn c''-\trill c''-\prall c''-\mordent c''-\prallprall c''-\prallmordent - c''-\upprall c''-\downprall } + c''-\upprall c''-\downprall c''-\thumb} \type Lyrics \lyrics{ accent marcato staccatissimo fermata stopped staccato tenuto upbow downbow lheel rheel ltoe rtoe turn open flageolet reverseturn trill prall - mordent prallprall prallmordent uprall downprall }> + mordent prallprall prallmordent uprall downprall thumb}> \paper{linewidth = 5.875\in; indent = 0.0; } @@ -576,6 +596,13 @@ code(\rc). A decrescendo mark is started with code(\decr) and terminated with code(\rced). There are also shorthands for these marks. A crescendo can be started with code(\<) and a decrescendo can be started with code(\>). Either one can be terminated with code(\!). +Note that code(\!) must go before the last note of the dynamic mark whereas +code(\rc) and code(\rced) go after the last note. Because these marks are +bound to notes, if you want to get several marks during one note, you must use +spacer notes. +mudela(fragment,verbatim,center)( +c'' \< \! c'' d'' \decr e'' \rced +< f''1 {s4 \< \! s4 \> \! s2 } >) Tremolo marks can be printed by a note by adding code(:)[var(length)] after the note. The length must be at least 8. A var(length) value @@ -868,6 +895,9 @@ dit(code(\accepts) var(string)code(;)) This keyword can appear only within a code(\translator) block. It specifies what contexts are allowed with the context that is being defined. See Section ref(translators). +dit(code(\alternative) code({) var(music1) var(music2) ... code(})) +Specifies alternative endings. Must come after a code(\repeat) keyword. + dit(code(\bar) var(bartype)code(;)) Prints a special bar symbol, or at measure boundaries, replaces the regular bar symbol with a special symbol. The argument var(bartype) is a string which specifies the @@ -906,6 +936,7 @@ mudela(center)( mudela(center)( \score{ \notes{\cadenza 1; \clef alto; c'4_"\kern -10mm alto" + \clef scarlatti; c'4_"\kern -4mm scarlatti" \clef mezzosoprano; c'4^"\kern -10mm mezzosoprano" \clef soprano; c'4_"\kern -10mm soprano" \clef treble; c'4^"\kern -6mm treble" @@ -943,8 +974,9 @@ Specifies information about the music. A header should appear at the top of the file describing the file's contents. If a file has multiple code(\score) blocks, then a header should appear in each score block describing its contents. Tools like code(ly2dvi) can -use this information for generating titles. Some possible key values -are: title, opus, description, composer, enteredby, and copyright. +use this information for generating titles. Key values that are used +by ly2dvi are: title, subtitle, composer, opus, poet, instrument, +metre, arranger, and piece. dit(code(\in)) Specify a dimension in inches. @@ -1041,6 +1073,16 @@ dit(code(\remove) var(string)code(;)) Can appear only in a code(\translator) block. Specifies that a performer or engraver named var(string) should be removed. See Section ref(translators). +dit(code(\repeat) var(count) code({) var(music) code(})) +Repeats the specified +music var(count) times. Alternative endings can be specified by adding a +code(\alternative) keyword after the code(\repeat). + +dit(code(\scm) var(scheme)code(;)) Embeds specified Scheme code. + +dit(code(\scmfile) var(filename)code(;)) Reads Scheme code from the specified +file. + dit(code(\score) var(statementlist)) Create a Score context. This is the top level notation context. COMMENT(this still needs work) @@ -1256,6 +1298,10 @@ direction, set to code(\up) to force slurs up, set to code(\down) to force slurs down. The shorthands code(\slurup), code(\slurdown), and code(\slurboth) are available. +dit(code(tieYDirection)) Set to code(\free) for free choice of tie +direction, set to code(\up) to force ties up, set to code(\down) to +force ties down. + dit(code(slurdash)) Set to 0 for normal slurs, 1 for dotted slurs, and a larger value for dashed slurs. Identifiers code(\slurnormal) and code(\slurdotted) are predefined to set the first two settings. @@ -1786,9 +1832,6 @@ dit(code(Local_key_engraver)) dit(code(Lyric_engraver)) Engraves lyrics. Normally in code(LyricVoice). dit(code(Multi_measure_rest_engraver)) Engraves multi-measure rests that are produced with code(R). Normally in code(Voice). -dit(code(Note_heads_engraver)) Engraves note heads. Normally in code(Voice). -Removing this gives a fatal error. -COMMENT(Perhaps should be Note_head_engraver) dit(code(Piano_bar_engraver)) dit(code(Pitch_squash_engraver)) Treat all pitches as middle C. Used in code(RhythmicStaff). Note that the notes move, but the locations of @@ -1799,6 +1842,8 @@ dit(code(Plet_swallow_engraver)) Swallows tuplet requests without any output. In code(LyricVoice). COMMENT( Should this be named Plet_req_swallow_translator? ) dit(code(Priority_horizontal_align_engraver)) +dit(code(Repeat_engraver)) Handles repeats? In code(Staff) and + code(RhythmicStaff). dit(code(Rest_collision_engraver)) Handles collisions of rests. In code(Staff). dit(code(Rest_engraver)) Engraves rests. Normally in code(Voice). dit(code(Rhythmic_column_engraver)) @@ -1824,6 +1869,7 @@ code(Staff) and code(RhythmicStaff). dit(code(Timing_engraver)) Responsible for synchronizing timing information from staffs. Normally in code(Score). In order to create polyrhythmic music, this engraver should be removed from code(Score) and placed in code(Staff). +dit(code(Tuplet_engraver)) Engraves tuplet brackets? In code(Staff). dit(code(Vertical_align_engraver)) ) diff --git a/Documentation/topdocs/index.yo b/Documentation/topdocs/index.yo index bf386aa4b4..11eb7166ed 100644 --- a/Documentation/topdocs/index.yo +++ b/Documentation/topdocs/index.yo @@ -4,7 +4,7 @@ DEFINEMACRO(pic)(1)(url(ARG1)(DOEXPAND(docdir)/pictures/DOEXPAND(outdir)/ARG1.pn )) DEFINEMACRO(beginbold)(0)(whenhtml(htmlcommand())) -DEFINEMACRO(endbold)(0)(whenhtml(htmlcommand())) +DEFINEMACRO(endbold)(0)(whenhtml(htmlcommand())) redef(htmlnewfile)(0)() setchapterstring() diff --git a/TODO b/TODO index 52d614df1a..587a96c2e5 100644 --- a/TODO +++ b/TODO @@ -6,11 +6,22 @@ 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/urg - BUGS: - * gallina barlines. + * fix height of / collisions with lyrics (chords), + see input/test/vertical-text.ly + + * repeat/volta: + - one volta spanner per score + - repeat bars span staffs + - placement alternative number + - dimensions of volta bracket + + * who is trying to print too (small/big) piano braces all the time? + warning: piano brace too small (16.000pt) + + * latex bla.tex broken (titles / \lilyfooter stuff?) * msgfmt -o check? @@ -34,19 +45,17 @@ BUGS: * space after bars? * [/3 c8 c16 c c c]/1 - + * fix singleStaffBracket - + * repeat bars: need distance after ":|" and before "|:" * The time signature warnings still remain, will be fixed later. - Summary of minor spelling irregularities: +ii Summary of minor spelling irregularities: - capitalization/use of underscores in property names - * fix Score.skipBars - - * repeat bars: need distance after ":|" and before "|:" + * fix SkipBars -> skipBars * \shape 1st dim skipped? @@ -67,6 +76,9 @@ BUGS: portato= \script { "portato" 0 -1 0 1 0 } STUFF + * uniformise recent feta contributions. + + * check out legal/(c) matters for scores. * move option processing out of gh_enter @@ -95,8 +107,6 @@ STUFF * revise documentation - * abbrev -> tremolo - * junking \skip req in lyrics * Language: @@ -227,6 +237,7 @@ ydirection and hshift preset * rename - plet -> tuplet - measure -> bar + - abbrev -> tremolo - abbreviation-beam -> (measured/unmeasured) tremolo - partial -> anacrouse @@ -418,7 +429,7 @@ PROJECTS * add to MIDI output: - tempo change - ornaments (and trills?) - - repeat + - repeat/volta - slurs - accents - dynamics @@ -531,8 +542,6 @@ INPUTLANGUAGE * relative mode for pitch entering - * bracket: volta 1,2 - * configure pitch_byte * rest name configurable @@ -597,8 +606,6 @@ SMALLISH PROJECTS * revise calcideal - * volta - IDEAS * Output data structures of Mudela in XML/SGML. diff --git a/aclocal.m4 b/aclocal.m4 index 46b9e1839e..50748a506a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -170,7 +170,7 @@ AC_DEFUN(AC_STEPMAKE_GUILE, [ AC_CHECK_LIB(guile, scm_boot_guile)\ ) if test "$ac_cv_lib_guile_scm_shell" != yes -a \ - "$ac_cv_lib_scm_boot_guile" != yes ; then + "$ac_cv_lib_guile_scm_boot_guile" != yes ; then AC_STEPMAKE_WARN(You should install guile 1.3 or newer) fi ]) diff --git a/init/engraver.ly b/init/engraver.ly index 81f5312937..078a6211ac 100644 --- a/init/engraver.ly +++ b/init/engraver.ly @@ -15,16 +15,16 @@ StaffContext=\translator { %} % \type "Hara_kiri_line_group_engraver"; + \consists "Repeat_engraver"; \consists "Bar_engraver"; \consists "Clef_engraver"; \consists "Key_engraver"; \consists "Local_key_engraver"; \consists "Time_signature_engraver"; - \consists "Repeat_engraver"; \consists "Staff_symbol_engraver"; \consists "Collision_engraver"; \consists "Rest_collision_engraver"; - \consists "Tuplet_engraver"; + %{ Uncomment to get bar numbers on single staff systems: @@ -77,8 +77,9 @@ RhythmicStaffContext=\translator{ \consists "Pitch_squash_engraver"; \consists "Separating_line_group_engraver"; \name RhythmicStaff; - \consists "Bar_engraver"; + \consists "Repeat_engraver"; + \consists "Bar_engraver"; \consists "Time_signature_engraver"; \consists "Staff_symbol_engraver"; \accepts "Voice"; @@ -101,6 +102,7 @@ VoiceContext = \translator { \consists "Font_size_engraver"; \consists "Slur_engraver"; \consists "Ties_engraver"; + \consists "Tuplet_engraver"; \consists "Note_heads_engraver" ; \consists "Skip_req_swallow_translator"; }; @@ -206,9 +208,9 @@ HaraKiriStaffContext = \translator { barColumnPriority = "0"; marginBreakPriority = "-4"; + \consists "Repeat_engraver"; \consists "Bar_engraver"; \consists "Clef_engraver"; - \consists "Repeat_engraver"; \consists "Key_engraver"; \consists "Time_signature_engraver"; \consists "Local_key_engraver"; @@ -243,6 +245,7 @@ OrchestralScoreContext= \translator { defaultClef = treble; \consists "Timing_engraver"; + \consists "Bar_column_engraver"; \consists "Bar_number_engraver"; \consists "Mark_engraver"; diff --git a/init/table16.ly b/init/table16.ly index d0c76c1c8b..a7c974e8f2 100644 --- a/init/table16.ly +++ b/init/table16.ly @@ -44,7 +44,7 @@ table_sixteen= "bars" = \table { "empty" "emptybar" 0 - "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "" "emptybar" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 16.0\pt "||" "doublebar" 1 0.0\pt 4.0\pt 0.0\pt 16.0\pt "|." "finishbar" 1 -4.0\pt 0.0\pt 0.0\pt 16.0\pt @@ -56,14 +56,9 @@ table_sixteen= } - "meters" = \table { - "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt - } - % dims ignored for this table "param" = \table { - "brace" "pianobrace" 1 0.0\pt 0.0\pt 32.0\pt 80.0\pt + "brace" "pianobrace" 1 0.0\pt 0.0\pt 32.0\pt 112.0\pt "bracket" "staffbracket" 1 0.0\pt 4.0\pt 16.0\pt 128.0\pt "extender" "extender" 1 0.0\pt 0.0\pt 1.0\pt 160.0\pt "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -8.0\pt 8.0\pt @@ -73,9 +68,5 @@ table_sixteen= } - "beamslopes" = \table { - "slope" "beamslope" 2 2.0\pt 64.0\pt 0.0\pt 0.0\pt - "horizontal" "rulesym" 2 - } } diff --git a/init/table20.ly b/init/table20.ly index f9f46746a7..ab27995a36 100644 --- a/init/table20.ly +++ b/init/table20.ly @@ -49,7 +49,7 @@ table_twenty = "bars" = \table { "empty" "emptybar" 0 - "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "" "emptybar" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 20.0\pt "||" "doublebar" 1 0.0\pt 5.0\pt 0.0\pt 20.0\pt "|." "finishbar" 1 -5.0\pt 0.0\pt 0.0\pt 20.0\pt @@ -60,26 +60,16 @@ table_twenty = ":|:" "repeatbarstartrepeat" 0 0.0\pt 20.0\pt 0.0\pt 20.0\pt } - "meters" = \table { - "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt - } - % dims ignored for this table "param" = \table { "bracket" "staffbracket" 1 0.0\pt 0.0\pt 20.0\pt 160.0\pt "extender" "extender" 1 0.0\pt 0.0\pt 1.0\pt 160.0\pt "rule" "rulesym" 2 - "brace" "pianobrace" 1 0.0\pt 0.0\pt 40.0\pt 100.0\pt + "brace" "pianobrace" 1 0.0\pt 0.0\pt 40.0\pt 140.0\pt "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -5.0\pt 5.0\pt "stem" "stem" 2 "fill" "hbox{}" 0 } - - "beamslopes" = \table { - "slope" "beamslope" 2 2.0\pt 64.0\pt 0.0\pt 0.0\pt - "horizontal" "rulesym" 2 - } } diff --git a/input/test/repeat.ly b/input/test/repeat.ly new file mode 100644 index 0000000000..f4dbf0feb9 --- /dev/null +++ b/input/test/repeat.ly @@ -0,0 +1,18 @@ +\score{ + < + \type Staff \notes\relative c''{ + c c c c + \repeat 2 { { d d d d } } + \alternative { { a a a a } { a a a a } } + } + \type Lyrics \lyrics { + De eer- ste < { maat } { moet } > + \repeat 2 { { } } + \alternative < + { en dan twee keer } + { een koe- plet _ } + > + en dan nog dit er ach- ter aan + } + > +} diff --git a/input/test/star.ly b/input/test/star.ly index 9ec0ea4a97..f498e0bf4d 100644 --- a/input/test/star.ly +++ b/input/test/star.ly @@ -56,19 +56,15 @@ $staff2_voice_2 = \notes { [g8. g16] fis4.~a,8 [d8 e8] fis2 [b8 b8] a4. a8 a,4 d2 s4 } -$text1 = \lyrics{ - Oh4 __ say. can you see,2 by8. the16 dawn's4 ear- ly light2 What8 +$text = \lyrics{ + Oh4 __ \repeat 2 { { } } + \alternative < + { say. can you see,2 by8. the16 dawn's4 ear- ly light2 What8 so8 proud-4. ly8 we4 hailed,2 At8. the16 twi-4 light's last gleam- - ing. Whose8. broad16 -} - -$text2 = \lyrics{ - _4 stripes and bright stars,2 through8 the8 per-4 il- ous fight,2 - O'er8 the8 ram-4. parts8 we4 watched,2 were8. so16 gal-4 lant- ly - _ _ _ -} - -$text3 = \lyrics{ + ing. Whose8. broad16 } + { stripes4 and bright stars,2 through8. the16 per-4 il- ous fight,2 + O'er8 the8 ram-4. parts8 we4 watched,2 were8. so16 gal-4 lant- ly } + > stream-4 ing. And8. the16 rock-4 ets' red glare,2 the8 bombs8 burst-4 ing in air,2 gave4 proof4. through8 the4 night2 that8. our16 flag4 was still there,2 Oh4 say, does that star- span- @@ -81,9 +77,7 @@ global = \notes { \key D; \partial 4; \skip 4; - \bar "|:"; \skip 2.*8; - \bar ":|"; \skip 2.*16; \skip 2.; \bar "|."; @@ -99,10 +93,7 @@ global = \notes { \notes \transpose c'' {\voicetwo \$staff1_voice_2 } > \type Lyrics = one \lyrics < -% urg, too much distance between two texts; fixme first -% \$text1 -% { \$text2 \$text3 } - { \$text1 \$text3 } + \$text > \type Staff=staffB < \global diff --git a/input/test/vertical-text.ly b/input/test/vertical-text.ly index 4d1d3d59e1..340815621c 100644 --- a/input/test/vertical-text.ly +++ b/input/test/vertical-text.ly @@ -1,8 +1,14 @@ \score{ < - \type Staff = o \notes\relative c,,, { \stemdown [c8 c c c] } - \type Lyrics \lyrics{ BLA bla } - \type Staff = t \notes\relative c''''' { \stemup [c8 c c c] } + \type Staff = o \notes\relative c,,, { + \stemdown [c8 c c c] c4 c4 \break [c8 c c c] c4 c4 + } + \type Lyrics \lyrics{ + BLA bla _2 < { BLA bla } { BLA bla } > _2 + } + \type Staff = t \notes\relative c''''' { + \stemup [c8 c c c] c4 c [c8 c c c] c4 c + } > \paper{ castingalgorithm = \Wordwrap; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 6c75f333d2..20a49da261 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -78,10 +78,6 @@ struct General_script_def; struct Graphical_element; struct Graphical_axis_group; -struct Mark_req; -struct Music_output; -struct Musical_pitch; -struct Music_output_def; struct Global_translator; struct Hara_kiri_line_group_engraver; struct Hara_kiri_vertical_group_spanner; @@ -114,7 +110,7 @@ struct Local_key_engraver; struct Lookup; struct Lyric_item; struct Lyric_req; -struct My_lily_lexer; +struct Mark_req; struct Measure_grouping_req; struct Melodic_req; struct Midi_def; @@ -137,14 +133,19 @@ struct Molecule; struct Multi_measure_rest; struct Multi_measure_rest_req; struct Multi_measure_rest_engraver; -struct Musical_script_req; -struct Music_list; +struct Music; struct Musical_req; struct Musical_span_req; -struct Music; +struct Musical_script_req; +struct Music_list; +struct Music_list_iterator; +struct Music_output; +struct Music_output_def; +struct Musical_pitch; struct Music_sequence; -struct Music_wrapper_iterator; struct Music_wrapper; +struct Music_wrapper_iterator; +struct My_lily_lexer; struct My_lily_parser; struct Note_column; struct Note_column_engraver; diff --git a/lily/include/lyric-engraver.hh b/lily/include/lyric-engraver.hh index 47a2b58bb1..15b5f510e0 100644 --- a/lily/include/lyric-engraver.hh +++ b/lily/include/lyric-engraver.hh @@ -14,17 +14,21 @@ #include "lily-proto.hh" -class Lyric_engraver : public Engraver { - Lyric_req* lreq_l_; - Text_item *lyric_item_p_; +class Lyric_engraver : public Engraver +{ protected: virtual void do_pre_move_processing(); virtual bool do_try_music (Music*); virtual void do_process_requests(); virtual void do_post_move_processing(); + public: - VIRTUAL_COPY_CONS(Translator); - Lyric_engraver(); + VIRTUAL_COPY_CONS(Translator); + +private: + Link_array lyric_req_l_arr_; + Link_array text_p_arr_; }; + #endif // LYRIC_ENGRAVER_HH diff --git a/lily/include/music-list-iterator.hh b/lily/include/music-list-iterator.hh new file mode 100644 index 0000000000..6cc15b5763 --- /dev/null +++ b/lily/include/music-list-iterator.hh @@ -0,0 +1,34 @@ +/* + music-list-iterator.hh -- declare Music_list_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1998 Jan Nieuwenhuizen +*/ + + +#ifndef MUSIC_LIST_ITERATOR_HH +#define MUSIC_LIST_ITERATOR_HH + +#include "music-iterator.hh" +#include "pcursor.hh" +#include "plist.hh" + +class Music_list_iterator : public Music_iterator +{ +public: + Music_list_iterator (); + virtual ~Music_list_iterator (); + + virtual void construct_children (); + virtual Moment next_moment () const; + virtual bool ok () const; + +protected: + Music_list* music_list_l () const; + + virtual void do_print () const; + virtual void do_process_and_next (Moment); +}; + +#endif // MUSIC_LIST_ITERATOR_HH diff --git a/lily/include/repeated-music-iterator.hh b/lily/include/repeated-music-iterator.hh index 081faa7c71..5495440493 100644 --- a/lily/include/repeated-music-iterator.hh +++ b/lily/include/repeated-music-iterator.hh @@ -10,14 +10,13 @@ #ifndef REPEATED_MUSIC_ITERATOR_HH #define REPEATED_MUSIC_ITERATOR_HH -#include "music-wrapper-iterator.hh" -#include "sequential-music-iterator.hh" +#include "music-list-iterator.hh" -class Repeated_music_iterator : public Music_iterator +class Repeated_music_iterator : public Music_list_iterator { public: Repeated_music_iterator (); - ~Repeated_music_iterator (); + virtual ~Repeated_music_iterator (); virtual void construct_children (); virtual Moment next_moment () const; @@ -25,12 +24,13 @@ public: protected: virtual Repeated_music* repeated_music_l () const; + virtual void do_print () const; virtual void do_process_and_next (Moment); private: Music_iterator* repeat_iter_p_; - Sequential_music_iterator* alternative_iter_p_; + Music_list_iterator* alternative_iter_p_; }; #endif /* REPEATED_MUSIC_ITERATOR_HH */ diff --git a/lily/include/sequential-music-iterator.hh b/lily/include/sequential-music-iterator.hh index bcbf81769c..8cf39854c8 100644 --- a/lily/include/sequential-music-iterator.hh +++ b/lily/include/sequential-music-iterator.hh @@ -1,33 +1,32 @@ /* - Sequential_music-iter.hh -- declare Sequential_music_iterator + Sequential_music-iterator.hh -- declare Sequential_music_iterator source file of the GNU LilyPond music typesetter (c) 1997--1998 Han-Wen Nienhuys */ -#ifndef SEQUENTIAL_MUSIC_ITER_HH -#define SEQUENTIAL_MUSIC_ITER_HH +#ifndef SEQUENTIAL_MUSIC_ITERATOR_HH +#define SEQUENTIAL_MUSIC_ITERATOR_HH -#include "music-iterator.hh" -#include "pcursor.hh" +#include "music-list-iterator.hh" /** Sequential_music iteration: walk each element in turn, and construct an iterator for every element. */ -class Sequential_music_iterator : public Music_iterator +class Sequential_music_iterator : public Music_list_iterator { public: Sequential_music_iterator (); - ~Sequential_music_iterator (); + virtual ~Sequential_music_iterator (); virtual void construct_children (); virtual Moment next_moment () const; virtual bool ok () const; protected: - Sequential_music * sequential_music_l() const; + Sequential_music* sequential_music_l () const; virtual void do_print() const; virtual void do_process_and_next (Moment); @@ -45,4 +44,4 @@ private: void set_Sequential_music_translator(); }; -#endif // SEQUENTIAL_MUSIC_ITER_HH +#endif // SEQUENTIAL_MUSIC_ITERATOR_HH diff --git a/lily/include/simultaneous-music-iterator.hh b/lily/include/simultaneous-music-iterator.hh new file mode 100644 index 0000000000..e2c1eb4ee6 --- /dev/null +++ b/lily/include/simultaneous-music-iterator.hh @@ -0,0 +1,35 @@ +/* + simultaneous-music-iterator.hh -- declare Simultaneous_music_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1997--1998 Han-Wen Nienhuys +*/ + + +#ifndef SIMULTANEOUS_MUSIC_ITERATOR_HH +#define SIMULTANEOUS_MUSIC_ITERATOR_HH + +#include "music-list-iterator.hh" + +class Simultaneous_music_iterator : public Music_list_iterator +{ +public: + Simultaneous_music_iterator (); + virtual ~Simultaneous_music_iterator (); + + virtual void construct_children (); + virtual Moment next_moment () const; + virtual bool ok () const; + +protected: + Simultaneous_music* simultaneous_music_l () const; + + virtual void do_print () const; + virtual void do_process_and_next (Moment); + +private: + Pointer_list children_p_list_; +}; + +#endif // SIMULTANEOUS_MUSIC_ITERATOR_HH diff --git a/lily/lookup.cc b/lily/lookup.cc index 1c3d1c7145..12265840d6 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -24,6 +24,17 @@ #include "main.hh" #include "lily-guile.hh" +SCM +array_to_list (SCM *a , int l) +{ + SCM list = SCM_EOL; + for (int i= l; i--; ) + { + list = gh_cons (a[i], list); + } + return list; +} + Lookup::Lookup () { @@ -97,9 +108,11 @@ Lookup::afm_find (String s, bool warn) const a.dim_ = m.B_; a.dim_[X_AXIS] *= 1 / 1000.0; a.dim_[Y_AXIS] *= 1 / 1000.0; - Array arr; - arr.push (m.code ()); - a.lambda_ = (lambda_scm ("char", arr)); + + + a.lambda_ = gh_list (ly_symbol ("char"), + gh_int2scm (m.code ()), + SCM_UNDEFINED); a.str_ = "afm_find: " + s; a.font_ = font_; return a; @@ -117,11 +130,15 @@ Lookup::ball (int j) const Atom Lookup::bar (String str, Real h) const { - Array arr; - arr.push (h); + Atom a = (*symtables_p_) ("bars")->lookup (str); - a.lambda_ = (lambda_scm (a.str_, arr)); - a.str_ = "bar"; + + + a.lambda_ = gh_list (ly_symbol (a.str_.ch_C()), + gh_double2scm (h), + SCM_UNDEFINED); + + a.dim_.y () = Interval (-h/2, h/2); a.font_ = font_; return a; @@ -134,14 +151,13 @@ Lookup::beam (Real slope, Real width, Real thick) const Real min_y = (0 ? height) + thick/2; - Array arr; - arr.push (width); - arr.push (slope); - arr.push (thick); - Atom a; - a.lambda_ = (lambda_scm ("beam", arr)); - a.str_ = "beam"; + a.lambda_ = gh_list (ly_symbol ("beam"), + gh_double2scm (width), + gh_double2scm (slope), + gh_double2scm (thick), + SCM_UNDEFINED); + a.dim_[X_AXIS] = Interval (0, width); a.dim_[Y_AXIS] = Interval (min_y, max_y); return a; @@ -156,7 +172,8 @@ Lookup::clef (String st) const SCM offset2scm (Offset o) { - return gh_list (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS]), SCM_UNDEFINED); + return gh_list (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS]), + SCM_UNDEFINED); } Atom @@ -179,13 +196,12 @@ Lookup::dashed_slur (Array controls, Real thick, Real dash) const sc[i] = offset2scm (controls[i]); } - // (lambda (o) (dashed-slur o thick dash '(stuff)) a.lambda_ = - gh_append2 (ly_lambda_o (), - gh_list (gh_append2 (ly_func_o ("dashed-slur"), - gh_cons (gh_double2scm (thick), - gh_cons (gh_double2scm (dash), - gh_list (ly_quote_scm (gh_list (sc[1], sc[2], sc[3], sc[0], SCM_UNDEFINED)), SCM_UNDEFINED)))), SCM_UNDEFINED)); + gh_list (ly_symbol ("dashed-slur"), + gh_double2scm (thick), + gh_double2scm (dash), + ly_quote_scm (array_to_list (sc, 4)), + SCM_UNDEFINED); a.str_ = "dashed_slur"; return a; @@ -207,9 +223,9 @@ Atom Lookup::extender (Real width) const { Atom a = (*symtables_p_) ("param")->lookup ("extender"); - Array arr; - arr.push (width); - a.lambda_ = (lambda_scm (a.str_, arr)); + a.lambda_ = gh_list (ly_symbol (a.str_), + gh_double2scm (width), + SCM_UNDEFINED); a.str_ = "extender"; a.font_ = font_; return a; @@ -251,12 +267,11 @@ Lookup::rest (int j, bool o) const Atom Lookup::rule_symbol (Real height, Real width) const { - Atom a = (*symtables_p_) ("param")->lookup ("rule"); - Array arr; - arr.push (height); - arr.push (width); - a.lambda_ = (lambda_scm (a.str_, arr)); - a.str_ = "rule_symbol"; + Atom a; + a.lambda_ = gh_list (ly_symbol ("rulesym"), + gh_double2scm (height), + gh_double2scm (width), + SCM_UNDEFINED); a.dim_.x () = Interval (0, width); a.dim_.y () = Interval (0, height); return a; @@ -302,16 +317,15 @@ Lookup::stem (Real y1, Real y2) const a.dim_.x () = Interval (0,0); a.dim_.y () = Interval (y1,y2); - Array arr; - Real stem_width = paper_l_->get_var ("stemthickness"); - arr.push (-stem_width /2); - arr.push (stem_width); - arr.push (y2); - arr.push (-y1); - a.lambda_ = (lambda_scm ("stem", arr)); - a.str_ = "stem"; + a.lambda_ = gh_list (ly_symbol ("stem"), + gh_double2scm(-stem_width /2), + gh_double2scm(stem_width), + gh_double2scm(y2), + gh_double2scm(-y1), + SCM_UNDEFINED); + a.font_ = font_; return a; } @@ -331,16 +345,15 @@ Dictionary afm_p_dict; Atom Lookup::text (String style, String text) const { - Array arr; - - arr.push (text); Atom a = (*symtables_p_) ("style")->lookup (style); - a.lambda_ = lambda_scm (a.str_, arr); + + a.lambda_ = gh_list(ly_symbol (a.str_), + gh_str02scm (text.ch_C()), + SCM_UNDEFINED); + Real font_w = a.dim_.x ().length (); Real font_h = a.dim_.y ().length (); -// urg -// if (!cmr_dict.length_i ()) if (!cmr_dict.elem_b ("roman")) { //brrrr @@ -393,7 +406,6 @@ Lookup::text (String style, String text) const } DOUT << "\n" << to_str (w) << "\n"; a.dim_.x () = Interval (0, w); - a.str_ = "text"; a.font_ = font_; return a; } @@ -403,43 +415,21 @@ Atom Lookup::time_signature (Array a) const { Atom s ((*symtables_p_) ("param")->lookup ("time_signature")); - s.lambda_ = (lambda_scm (s.str_, a)); - + s.lambda_ = gh_list (ly_symbol (s.str_), + gh_int2scm (a[0]), + gh_int2scm (a[1]), + SCM_UNDEFINED); return s; } -/* - should be handled via Tex_ code and Lookup::bar () - */ Atom Lookup::vbrace (Real &y) const { - Atom a = (*symtables_p_) ("param")->lookup ( "brace"); - Interval ydims = a.dim_[Y_AXIS]; - Real min_y = ydims[LEFT]; - Real max_y = ydims[RIGHT]; - Real step = 1.0 PT; - - if (y < min_y) - { - warning (_ ("piano brace") - + " " + _ ("too small") + " (" + print_dimen (y) + ")"); - y = min_y; - } - if (y > max_y) - { - warning (_ ("piano brace") - + " " + _ ("too big") + " (" + print_dimen (y) + ")"); - y = max_y; - } - - - int idx = int (rint ( (y- min_y)/step)) + 1; - - Array arr; - arr.push (idx); - a.lambda_ = (lambda_scm (a.str_, arr)); - a.str_ = "brace"; + Atom a; + a.lambda_ = gh_list (ly_symbol ("pianobrace"), + gh_double2scm (y), + SCM_UNDEFINED + ); a.dim_[Y_AXIS] = Interval (-y/2,y/2); a.font_ = font_; return a; @@ -450,13 +440,13 @@ Lookup::hairpin (Real width, bool decresc, bool continued) const { Atom a; Real height = paper_l_->staffheight_f () / 6; - Array arr; - arr.push (width); - arr.push (height); - arr.push (continued ? height/2 : 0); + String hairpin = String (decresc ? "de" : "") + "crescendo\n"; - a.lambda_ = (lambda_scm (hairpin, arr)); - a.str_ = "hairpin"; + a.lambda_ = gh_list (ly_symbol (hairpin), + gh_double2scm (width), + gh_double2scm (height), + gh_double2scm (continued ? height/2 : 0.0), + SCM_UNDEFINED); a.dim_.x () = Interval (0, width); a.dim_.y () = Interval (-2*height, 2*height); a.font_ = font_; @@ -466,21 +456,19 @@ Lookup::hairpin (Real width, bool decresc, bool continued) const Atom Lookup::plet (Real dy , Real dx, Direction dir) const { - Array arr; - arr.push (dx); - arr.push (dy); - arr.push (dir); Atom a; - a.lambda_ = (lambda_scm ("tuplet", arr)); - a.str_ = "plet"; + a.lambda_ = gh_list(ly_symbol ("tuplet"), + gh_double2scm (dx), + gh_double2scm (dy), + gh_int2scm (dir)); return a; } + Atom Lookup::slur (Array controls) const { assert (controls.size () == 8); - Real dx = controls[3].x () - controls[0].x (); Real dy = controls[3].y () - controls[0].y (); Atom a; @@ -492,25 +480,9 @@ Lookup::slur (Array controls) const scontrols[i] = offset2scm (controls[indices[i]]); - a.lambda_ = - gh_append2 (ly_lambda_o (), - gh_list (gh_append2 (ly_func_o ("slur"), - gh_list (ly_quote_scm (gh_list (scontrols[0], - scontrols[1], - scontrols[2], - scontrols[3], - scontrols[4], - scontrols[5], - scontrols[6], - scontrols[7], - SCM_UNDEFINED)), - SCM_UNDEFINED) - ), - SCM_UNDEFINED) - ); - - - a.str_ = "slur"; + a.lambda_ =gh_list (ly_symbol ("slur"), + ly_quote_scm (array_to_list (scontrols, 8)), + SCM_UNDEFINED); a.dim_[X_AXIS] = Interval (0, dx); a.dim_[Y_AXIS] = Interval (0 ? dy); @@ -529,9 +501,10 @@ Lookup::vbracket (Real &y) const + " " + _ ("too small") + " (" + print_dimen (y) + ")"); // y = min_y; } - Array arr; - arr.push (y); - a.lambda_ = (lambda_scm ("bracket", arr)); + + a.lambda_ = gh_list (ly_symbol ("bracket"), + gh_double2scm (y), + SCM_UNDEFINED); a.str_ = "vbracket"; a.dim_[Y_AXIS] = Interval (-y/2,y/2); a.dim_[X_AXIS] = Interval (0,4 PT); @@ -541,12 +514,15 @@ Lookup::vbracket (Real &y) const Atom Lookup::volta (Real w, bool last_b) const { - Array arr; - arr.push (w); - arr.push (last_b); Atom a; - a.lambda_ = (lambda_scm ("volta", arr)); + a.lambda_ = gh_list (ly_symbol ("volta"), + gh_double2scm (w), + gh_int2scm (last_b), + SCM_UNDEFINED); a.str_ = "volta"; + Real interline_f = paper_l_->interline_f (); + a.dim_[Y_AXIS] = Interval (-interline_f / 2, interline_f / 2); + a.dim_[X_AXIS] = Interval (0, w); return a; } diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index d3c6fdf657..bac629b385 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -4,6 +4,7 @@ source file of the GNU LilyPond music typesetter (c) 1997--1998 Han-Wen Nienhuys + Jan Nieuwenhuizen */ #include "lyric-engraver.hh" @@ -13,19 +14,20 @@ #include "lookup.hh" #include "paper-def.hh" #include "main.hh" +#include "dimensions.hh" + +ADD_THIS_TRANSLATOR(Lyric_engraver); Lyric_engraver::Lyric_engraver() { - lreq_l_ =0; - lyric_item_p_ =0; } bool Lyric_engraver::do_try_music (Music*r) { - if (Lyric_req * lr = dynamic_cast (r)) + if (Lyric_req* l = dynamic_cast (r)) { - lreq_l_ = lr; + lyric_req_l_arr_.push (l); return true; } return false; @@ -34,46 +36,48 @@ Lyric_engraver::do_try_music (Music*r) void Lyric_engraver::do_process_requests() { - if (lreq_l_) + if (text_p_arr_.size ()) + return; + + Scalar style = get_property ("textstyle"); + Scalar alignment = get_property ("textalignment"); + for (int i=0; i < lyric_req_l_arr_.size (); i++) { - Text_def *td_p = new Text_def; - td_p->text_str_ = lreq_l_->text_str_; - td_p->align_dir_ = LEFT; - Scalar style = get_property ("textstyle"); + Lyric_req* request_l = lyric_req_l_arr_[i]; + Text_def* text_p = new Text_def; + text_p->text_str_ = request_l->text_str_; + text_p->align_dir_ = LEFT; if (style.length_i ()) - { - td_p->style_str_ = style; - } - Scalar alignment = get_property ("textalignment"); + text_p->style_str_ = style; if (alignment.isnum_b()) - { - td_p->align_dir_= (Direction)(int)alignment; - } + text_p->align_dir_= (Direction)(int)alignment; - lyric_item_p_ = new Text_item (td_p); - - lyric_item_p_->dir_ = DOWN; - lyric_item_p_->fat_b_ = true; - announce_element (Score_element_info (lyric_item_p_, lreq_l_)); + Text_item* item_p = new Text_item (text_p); + item_p->dir_ = DOWN; + item_p->fat_b_ = true; + // urg + // item_p->translate (Offset (0, (i - 1) * item_p->height ().length_i ())); +// if (i && ((Text_def*)text_p_arr_[i - 1]->tdef_p_)->text_str_.length_i ()) + // urg, when/how can one get the heigt of this thing? + item_p->translate (Offset (0, - i * 12 PT)); + text_p_arr_.push (item_p); + announce_element (Score_element_info (item_p, request_l)); } } void Lyric_engraver::do_post_move_processing() { - lreq_l_ =0; } void Lyric_engraver::do_pre_move_processing() { - if (lyric_item_p_) + for (int i=0; i < text_p_arr_.size (); i++) { - typeset_element (lyric_item_p_); - lyric_item_p_ =0; + typeset_element (text_p_arr_[i]); } + text_p_arr_.clear (); + lyric_req_l_arr_.clear (); } - - -ADD_THIS_TRANSLATOR(Lyric_engraver); diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 718490df5e..3d22831fbf 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -8,10 +8,10 @@ #include "debug.hh" #include "music-list.hh" #include "music-iterator.hh" -#include "sequential-music-iterator.hh" #include "property-iterator.hh" -#include "chord-iterator.hh" #include "request-iterator.hh" +#include "sequential-music-iterator.hh" +#include "simultaneous-music-iterator.hh" #include "translator-group.hh" #include "translation-property.hh" #include "change-iterator.hh" diff --git a/lily/music-list-iterator.cc b/lily/music-list-iterator.cc new file mode 100644 index 0000000000..d243aed3f1 --- /dev/null +++ b/lily/music-list-iterator.cc @@ -0,0 +1,52 @@ +/* + Music_list-iterator.cc -- implement Music_list_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1998 Jan Nieuwenhuizen +*/ + +#include "music-list-iterator.hh" +#include "music-list.hh" + +Music_list_iterator::Music_list_iterator () +{ +} + +Music_list_iterator::~Music_list_iterator () +{ +} + +void +Music_list_iterator::construct_children () +{ +} + +void +Music_list_iterator::do_print() const +{ +} + +void +Music_list_iterator::do_process_and_next (Moment) +{ +} + +Music_list* +Music_list_iterator::music_list_l () const +{ + return (Music_list *) music_l_; +} + +Moment +Music_list_iterator::next_moment () const +{ + return 0; +} + +bool +Music_list_iterator::ok () const +{ + return false; +} + diff --git a/lily/parser.yy b/lily/parser.yy index 9b27b9a120..64c9dd8bae 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -739,15 +739,19 @@ Alternative_music: { Music_list* m = new Music_list; $$ = new Sequential_music (m); } - | ALTERNATIVE '{' Music_list '}' { - $$ = new Sequential_music ($3); + | ALTERNATIVE Simultaneous_music { + $$ = $2; + } + | ALTERNATIVE Sequential_music { + $$ = $2; } ; Repeated_music: REPEAT unsigned '{' Music '}' Alternative_music { // s/r conflicts -> '{' '}' - Sequential_music* s = (Sequential_music*)$6; - $$ = new Repeated_music ($4, $2, s); + Music_sequence* m = dynamic_cast ($6); + assert (m); + $$ = new Repeated_music ($4, $2, m); } ; diff --git a/lily/repeat-engraver.cc b/lily/repeat-engraver.cc index f2f2c19e97..3558b8d05a 100644 --- a/lily/repeat-engraver.cc +++ b/lily/repeat-engraver.cc @@ -29,10 +29,24 @@ Repeat_engraver::do_try_music (Music* m) { if (Repeated_music* r = dynamic_cast (m)) { - repeated_music_arr_.push (r); - stop_mom_arr_.push (now_moment () + r->repeat_p_->duration () - + r->alternative_p_->music_p_list_p_->top ()->duration ()); + Moment stop_mom = now_moment () + r->repeat_p_->duration () + + r->alternative_p_->music_p_list_p_->top ()->duration (); Moment alt_mom = now_moment () + r->repeat_p_->duration (); + /* + TODO: + figure out what we don't want. + + we don't want to print more than one set of + |: :| and volta brackets on one staff. + + counting nested repeats, it seems safest to forbid + two pieces of alternative music to start at the same time. + */ + for (int i = 0; i < alternative_start_mom_arr_.size (); i++) + if (alternative_start_mom_arr_[i] == alt_mom) + return false; + repeated_music_arr_.push (r); + stop_mom_arr_.push (stop_mom); for (PCursor i (r->alternative_p_->music_p_list_p_->top ()); i.ok (); i++) { alternative_music_arr_.push (i.ptr ()); diff --git a/lily/repeated-music-iterator.cc b/lily/repeated-music-iterator.cc index 768a289b8f..5faf0880e7 100644 --- a/lily/repeated-music-iterator.cc +++ b/lily/repeated-music-iterator.cc @@ -94,8 +94,8 @@ Repeated_music_iterator::ok () const Repeated_music_iterator *urg = (Repeated_music_iterator*)this; delete urg->repeat_iter_p_; urg->repeat_iter_p_ = 0; - urg->alternative_iter_p_ = dynamic_cast - (get_iterator_p (repeated_music_l ()->alternative_p_)); + urg->alternative_iter_p_ = dynamic_cast + (get_iterator_p ((Music*)repeated_music_l ()->alternative_p_)); } } if (alternative_iter_p_) diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc new file mode 100644 index 0000000000..764bcdfe8b --- /dev/null +++ b/lily/simultaneous-music-iterator.cc @@ -0,0 +1,96 @@ +/* + Simultaneous_music-iterator.cc -- implement Simultaneous_music_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1997--1998 Han-Wen Nienhuys +*/ + +#include "translator-group.hh" +#include "debug.hh" +#include "simultaneous-music-iterator.hh" + +#include "music-list.hh" + +Simultaneous_music_iterator::Simultaneous_music_iterator () +{ +} + +Simultaneous_music_iterator::~Simultaneous_music_iterator () +{ +} + +void +Simultaneous_music_iterator::construct_children() +{ + int j = 0; + for (PCursor i (simultaneous_music_l ()->music_p_list_p_->top()); + i.ok(); j++, i++) + { + Music_iterator * mi = get_iterator_p (i.ptr()); + if (mi->ok()) + { + if (simultaneous_music_l ()->translator_type_str_.empty_b ()) + set_translator (mi->report_to_l()->ancestor_l (0)); + children_p_list_.bottom().add (mi); + } + else + delete mi; + } +} + + +void +Simultaneous_music_iterator::do_print() const +{ +#ifndef NPRINT + for (PCursor i (children_p_list_.top()); i.ok (); i++) + { + i->print(); + } +#endif +} + +void +Simultaneous_music_iterator::do_process_and_next (Moment until) +{ + for (PCursor i (children_p_list_.top()); i.ok ();) + { + if (i->next_moment() == until) + { + i->process_and_next (until); + } + if (!i->ok()) + delete i.remove_p(); + else + i++; + } + Music_iterator::do_process_and_next (until); +} + + + + +Moment +Simultaneous_music_iterator::next_moment() const +{ + Moment next; + next.set_infinite (1); + for (PCursor i (children_p_list_.top()); i.ok (); i++) + next = next next_moment() ; + return next; +} + + + +bool +Simultaneous_music_iterator::ok() const +{ + return children_p_list_.size(); +} + +Simultaneous_music* +Simultaneous_music_iterator::simultaneous_music_l ()const +{ + return ( Simultaneous_music *) music_l_; +} diff --git a/lily/text-def.cc b/lily/text-def.cc index bbdac9dee9..ecff7e8479 100644 --- a/lily/text-def.cc +++ b/lily/text-def.cc @@ -66,7 +66,9 @@ Text_def::get_atom (Paper_def *p, Direction) const a.translate_axis (-(align_dir_ + 1)* guess_width_f (a) / 2, X_AXIS); // urg 1/1 is too much; see input/test/vertical-text.ly - a.translate_axis (a.dim_.y ().length () * 9 / 10, Y_AXIS); +// a.translate_axis (a.dim_.y ().length () * 9 / 10, Y_AXIS); + // fine for one lyric, urg for lyric chord + a.translate_axis (a.dim_.y ().length () * 2 / 5, Y_AXIS); return a; } diff --git a/lily/text-item.cc b/lily/text-item.cc index eb4383f324..b625254867 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -75,6 +75,8 @@ Text_item::brew_molecule_p () const if (dir_<0) // should do something better anyway. mol_p->translate_axis (mol_p->extent ().y ().left , Y_AXIS); mol_p->translate_axis (coordinate_offset_f_, Y_AXIS); + // fine for one lyric, urg for lyric chord + mol_p->translate_axis (a.dim_.y ().length (), Y_AXIS); return mol_p; } diff --git a/mf/feta-beugel.mf b/mf/feta-beugel.mf index 7acd135471..7f8558f69b 100644 --- a/mf/feta-beugel.mf +++ b/mf/feta-beugel.mf @@ -39,6 +39,6 @@ endchar; enddef; -for h := 2 staffsize# step 1 pt# until (6 * staffsize#): +for h := 2 staffsize# step 1 pt# until (7 * staffsize#): draw_brace(h, interline# ); endfor diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index ab45326524..01156c40ec 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -168,7 +168,7 @@ AC_DEFUN(AC_STEPMAKE_GUILE, [ AC_CHECK_LIB(guile, scm_boot_guile)\ ) if test "$ac_cv_lib_guile_scm_shell" != yes -a \ - "$ac_cv_lib_scm_boot_guile" != yes ; then + "$ac_cv_lib_guile_scm_boot_guile" != yes ; then AC_STEPMAKE_WARN(You should install guile 1.3 or newer) fi ]) diff --git a/stepmake/bin/add-html-footer.py b/stepmake/bin/add-html-footer.py index e8a858a0c9..669a319ac3 100644 --- a/stepmake/bin/add-html-footer.py +++ b/stepmake/bin/add-html-footer.py @@ -9,6 +9,7 @@ version = '0.1' import sys import os +import time from string import * import getopt import __main__ @@ -20,6 +21,12 @@ index_file='' banner_file = '' news_file='' news ='' +footer = '\n


Please take me back to the index\n\ +of %s\n' +builtstr = '\n
\n\ +This page was built from %s-%s by\ +

%s <%s>, at %s.

' + (options, files) = getopt.getopt(sys.argv[1:], 'hp:', ['help', 'news=', 'index=', 'package=']) def help (): @@ -48,6 +55,9 @@ from packagepython import * package = Package (topdir) packager = Packager () +if package.NAME == 'LILYPOND': + package.Name = 'GNU LilyPond' + def set_vars(): os.environ["CONFIGSUFFIX"] = 'www'; if os.name == 'nt': @@ -61,17 +71,16 @@ def set_vars(): set_vars () -backstr = '\n


Please take me back to the index\n\ -of ' + package.Name + '\n' -builtstr = '\n
\n\ -This page was built from ' + package.name + '-%s by

\n\ -


%s <%s>
\n\ -

' - def footstr(index): - s = backstr % index - s = s + builtstr % (version_tuple_to_str (package.version), fullname, - packager.mail, packager.mail) + try: + footer = gulp_file (package.topdir + '/Documentation/footer.html.in') + except: + pass + s = footer % (index, package.Name, packager.webmaster, packager.webmaster) + s = s + builtstr % (package.Name, + version_tuple_to_str (package.version), fullname, + packager.mail, packager.mail, + time.strftime ('%c %Z', time.localtime (time.time ()))) return s banner = footstr (index_file) diff --git a/stepmake/bin/packagepython.py b/stepmake/bin/packagepython.py index 68c7abdc67..a1b8bab546 100755 --- a/stepmake/bin/packagepython.py +++ b/stepmake/bin/packagepython.py @@ -61,6 +61,11 @@ class Packager: except KeyError: m= '(address unknown)' self.mail= m + try: + m= os.environ['WEBMASTER'] + except KeyError: + m= self.mail + self.webmaster= m def full_version_tup(tup): diff --git a/tex/fetdefs.tex b/tex/fetdefs.tex index 20b12df5e0..ee03b11bcf 100644 --- a/tex/fetdefs.tex +++ b/tex/fetdefs.tex @@ -12,7 +12,7 @@ \font\bracefontsixteen = feta-braces16 \font\fingerfontsixteen = feta-nummer4 \font\markfontsixteen = feta-nummer10 - \font\fetanummerjsixteen = feta-nummer6 + \font\fetanummerjsixteen = feta-nummer5 \def\currentsize{sixteen} }