From: fred Date: Wed, 27 Mar 2002 00:48:22 +0000 (+0000) Subject: lilypond-1.3.125 X-Git-Tag: release/1.5.59~966 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3cc7c2f4ed5dbc49f8a06b4fb621bade73a65c11;p=lilypond.git lilypond-1.3.125 --- diff --git a/Documentation/topdocs/README.texi b/Documentation/topdocs/README.texi index f1b3d8ded8..5c0af13b71 100644 --- a/Documentation/topdocs/README.texi +++ b/Documentation/topdocs/README.texi @@ -15,7 +15,7 @@ the GNU Project. LilyPond uses a versioning scheme similar to the Linux kernel. In a version "x.y.z", an even second number 'y' denotes a stable version. -For development versions 'y' is odd. Sh, in theory, version 1.2 is stable, +For development versions 'y' is odd. So, in theory, version 1.2 is stable, which means that there are no glaring errors in it. In practice 1.2.x is also unmaintained. @@ -116,11 +116,6 @@ questions use @email{help-gnu-music@@gnu.org} and @email{gnu-music-discuss@@gnu.org}. Please consult the FAQ and installation instructions before mailing your problems. -@section CDROM distributions - -If you have received LilyPond on a cdrom, chances are that development -has moved some patchlevels up. Please check the latest version of -LilyPond before reporting bugs. @bye diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 2259ace7e6..b73273417f 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -80,7 +80,7 @@ deep-symlinks: cd $(outdir) && rm -f lilypond && ln -s . lilypond cd $(outdir) && rm -f lilypond-internals && ln -s . lilypond-internals cd $(outdir) && $(foreach i, $(LILYPOND_LINKS),\ - rm -f $(i) && ln -s $(i) lilypond.html &&) true + rm -f $(i) && ln -s lilypond.html $(i) &&) true endif diff --git a/Documentation/user/bugs.itexi b/Documentation/user/bugs.itexi index e9fb63e084..4a4806fdaa 100644 --- a/Documentation/user/bugs.itexi +++ b/Documentation/user/bugs.itexi @@ -11,11 +11,13 @@ information: @itemize @bullet -@item @strong{important:} a sample input which causes the error. +@item a sample input which causes the error. This is @strong{important +} to determine the cause of the problem. (and you will do us a favor if send a @strong{small} sample file) -@item @strong{important:} which LilyPond version you use. +@item which LilyPond version you use. This is @strong{important information} + This information tells us if you've found a new bug, or an old one. diff --git a/Documentation/user/convert-ly.itexi b/Documentation/user/convert-ly.itexi index 1b8bf18726..55f0a72440 100644 --- a/Documentation/user/convert-ly.itexi +++ b/Documentation/user/convert-ly.itexi @@ -1,7 +1,7 @@ @c -*-texinfo-*- -@node Convert-ly -@section Convert-ly +@node convert-ly +@section convert-ly Convert-ly sequentially applies different diff --git a/Documentation/user/development.itexi b/Documentation/user/development.itexi index d21699b48b..39bfb5c978 100644 --- a/Documentation/user/development.itexi +++ b/Documentation/user/development.itexi @@ -6,11 +6,13 @@ @menu * Conversion stages:: Lilypond is a multi-pass program. +* Moment:: * Grobs:: Graphical object * Engraver:: * Music_iterator:: * Music:: * Molecules:: Molecules are stand-alone descriptions of output +* Font metrics:: Font metrics @end menu @node Conversion stages @@ -66,6 +68,18 @@ are output, line by line. @end table +@node Moment +@section Moment + +Moment is a rational number. Since GUILE doesn't support them natively, +so we created our own rational data type. + +@defun moment? +@end defun + +@defun make-moment num den +create the rational number @var{num}/@var{den}. +@end defun @node Grobs @section Grobs @@ -95,6 +109,7 @@ how grobs work. * Setting grob properties:: * Items and Spanners:: * Pointer substitution:: +* Grob Scheme functions:: @end menu @node What is a grob? @@ -326,6 +341,26 @@ complications. When a spanner crosses a line-break, then the spanner is the grob is made. A substitution process redirects all grob-reference so that spanner grob will only reference other grobs in the same line. +@node Grob Scheme functions +@unnumberedsubsec Grob Scheme functions + + +@defun ly-get-grob-property g sym + Get the value of a value in grob @var{g} of property @var{sym}. It +will return @code{'()} (end-of-list) if not true. +@end defun + +@defun ly-set-grob-property g sym val +@end defun + +@defun ly-get-spanner-bound spanner dir +@end defun + +@defun ly-grob? g +@end defun + + + @node Engraver @section Engraver @@ -382,6 +417,40 @@ name of the property is @code{molecule-callback}, and its value should be a Scheme function taking one argument (the grob) and returning a Molecule. +@defun molecule? m +@end defun + +@defun ly-combine-molecule-at-edge mol1 axis dir mol2 padding +@end defun + +@defun molecule? m +@end defun + +@defun ly-get-molecule-extent! mol axis +@end defun + +@defun ly-set-molecule-extent! mol axis extent +@end defun + +@node Font metrics +@section Font metrics + +The font object represents the metric information of a font. Every font +that is loaded into LilyPond can be accessed via Scheme. + +[tfm vs. afm] + + +@defun ly-get-default-font gr +This returns the default font for grob @var{gr}. +@end defun + +@defun ly-find-glyph-by-name font name +This function retrieves a Molecule for the glyph named @var{name} in +@var{font}. The font must be available as a afm file. +@cindex afm file + +@end defun @node Development @@ -940,6 +1009,11 @@ TODO file, listed on the homepage of Jan and @uref{http://www.cs.uu.nl/~hanwen/lily-devel,Han-Wen}. Modifying LilyPond almost always requires patches to the C++ part. +If you still don't have any idea what to do, you might want to browse +the mailing lists; Users do lots of feature requests, and you could +implement any of them. + + There are also numerous other interesting projects that are more or less related to LilyPond diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index c6c63bd78b..946b153ce1 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -110,11 +110,12 @@ this and other documentation. * Bug reports:: Where to report bugs. * Reference Manual:: Reference Manual. * Features:: Features, tips and tricks. -* Internals:(lilypond-internals). Auto generated detailed documentation. -* Programs:: External programs. +* Utility programs:: External programs. * Internals:: How it all works. * Development:: On developing code for LilyPond. -* Index:: Unified index. +* Index of internals:(lilypond-internals). Auto generated detailed documentation. +* Index:: Unified index. +* Function Index:: Function index. @end menu @contents @@ -142,4 +143,11 @@ this and other documentation. @printindex cp +@node Function Index +@unnumbered Function Index + +@printindex fn + + + @bye diff --git a/Documentation/user/ly2dvi.itexi b/Documentation/user/ly2dvi.itexi index 345d04870d..5ce8cc88c0 100644 --- a/Documentation/user/ly2dvi.itexi +++ b/Documentation/user/ly2dvi.itexi @@ -1,7 +1,7 @@ @c -*-texinfo-*- -@node Ly2dvi -@section Ly2dvi +@node ly2dvi +@section ly2dvi Ly2dvi is a Python script which creates input file for La@TeX{}, based on information from the output files from LilyPond. diff --git a/Documentation/user/midi2ly.itexi b/Documentation/user/midi2ly.itexi index 3ba298539a..7a2841012d 100644 --- a/Documentation/user/midi2ly.itexi +++ b/Documentation/user/midi2ly.itexi @@ -1,7 +1,7 @@ @c -*-texinfo-*- -@node Midi2ly -@section Midi2ly +@node midi2ly +@section midi2ly Midi2ly translates a MIDI input file to a LilyPond source file. Midi2ly is part of the GNU LilyPond music typesetting package. diff --git a/Documentation/user/programs.itexi b/Documentation/user/programs.itexi index 6bd147ab36..e475978aa4 100644 --- a/Documentation/user/programs.itexi +++ b/Documentation/user/programs.itexi @@ -1,12 +1,12 @@ @c -*-texinfo-*- -@node Programs -@chapter Programs +@node Utility programs +@chapter Utility programs @menu -* Ly2dvi:: Generating nice output with titles. -* Convert-ly:: Upgrading input files. -* Midi2ly:: Converting from MIDI input. +* ly2dvi:: Generating nice output with titles. +* convert-ly:: Upgrading input files. +* midi2ly:: Converting from MIDI input. @end menu @mbinclude ly2dvi.itexi diff --git a/input/bugs/forte.ly b/input/bugs/forte.ly new file mode 100644 index 0000000000..bed65d14d7 --- /dev/null +++ b/input/bugs/forte.ly @@ -0,0 +1,10 @@ + +% y-pos of f is wrong + +\score { + \notes \relative c' \context Voice = viola { + + \stemDown g'8. b,16 + s1 s2. r4 + g } +} diff --git a/input/test/bar-break.ly b/input/test/bar-break.ly index 37a6ee138d..8b13789179 100644 --- a/input/test/bar-break.ly +++ b/input/test/bar-break.ly @@ -1,28 +1 @@ -\score -{ - \context StaffGroup = a < - \context PianoStaff = b < - \context Staff = "c" \notes\relative c'' { b4 b \bar "empty"; \break b b } - \context Staff = "d" \notes\relative c'' { b4 b b b } - > - > - \paper { - indent=100.0\mm; - linewidth=150.0\mm; - \translator { - \StaffContext - \consists "Instrument_name_engraver"; - numberOfStaffLines = #1 - marginScriptPadding = #30 % urg: this is in PT - instrument = #"Foo" - instr = #"Bar" - } - \translator { - \StaffGroupContext - \consists "Instrument_name_engraver"; - marginScriptPadding = #10 % urg: this is in PT - instrument = #"Piano in het midden" - } - } -} diff --git a/input/test/generic-output-property.ly b/input/test/generic-output-property.ly index f0368e7daa..f3a5586586 100644 --- a/input/test/generic-output-property.ly +++ b/input/test/generic-output-property.ly @@ -1,7 +1,7 @@ \header{ texidoc=" -As a last resort, the placement of items can be adjusted manually, by -setting the @code{extra-offset} of an output object. +As a last resort, the placement of grobs can be adjusted manually, by +setting the @code{extra-offset} of a grob. "; } @@ -22,9 +22,5 @@ setting the @code{extra-offset} of an output object. } \paper{ linewidth=-1.0; - \translator { - \ScoreContext - \consists "Mark_engraver"; - } } } diff --git a/input/test/glissando.ly b/input/test/glissando.ly index 74d43fba58..115c5c2883 100644 --- a/input/test/glissando.ly +++ b/input/test/glissando.ly @@ -1,15 +1,23 @@ \header{ -texidoc=" -Simple glissando lines between notes are supported. The first two glissandi are not consecutive. + +texidoc=" Simple glissando lines between notes are supported. +The first two glissandi are not consecutive. + +The engraver does no time-keeping, so it involves some trickery to get +< @{ s8 s8 s4 @} @{ c4 \\gliss d4 @} > working correctly. + "; } \score{ \context Staff=one \notes\relative c''{ - % gliss non gliss and - c \glissando d e \glissando f\break + % gliss non gliss and + c4 \glissando d e \glissando f \glissando \break % consecutive - c \glissando d \glissando e f + c \glissando d \glissando e + < { \stemUp e8 \glissando g8 } + \context Voice = VB {\stemDown \repeat unfold 4 d16 } > + } \paper{ linewidth = 70.\mm; @@ -19,4 +27,4 @@ Simple glissando lines between notes are supported. The first two glissandi are % \remove Clef_engraver; } } -} \ No newline at end of file +} diff --git a/input/test/slur-proof.ly b/input/test/slur-proof.ly index 8853a63a38..6673652e45 100644 --- a/input/test/slur-proof.ly +++ b/input/test/slur-proof.ly @@ -1,7 +1,6 @@ -% :-( x = { -\outputproperty #(make-type-checker 'Note_head) #'extra-offset = #'(-1 . 0) +\outputproperty #(make-type-checker 'note-head-interface) #'extra-offset = #'(-1 . 0) } \score{ @@ -39,8 +38,8 @@ indent=0.0\mm; linewidth=-1.0\mm; \translator{ \VoiceContext -slurVerticalDirection = #1 -stemVerticalDirection = #-1 +Slur \override #'direction = #1 +Stem \override #'direction = #-1 } } } diff --git a/input/test/stem-tremolo.ly b/input/test/stem-tremolo.ly index 907608ac5e..3493dabef1 100644 --- a/input/test/stem-tremolo.ly +++ b/input/test/stem-tremolo.ly @@ -10,10 +10,8 @@ tremolo must be centered on the note. \version "1.3.117"; \score{ \context Voice\notes \relative c''{ - %%? - \property Voice.textVerticalDirection = #1 - %% burp, is this in staff or half spaces, or what? - \property Voice.textScriptPadding = #15 + \property Voice.Text \set #'direction = #1 + \property Voice.TextScript \set #'padding = #5 a1:4^":4" a:8^":8" c:16^":16" a:32^":32" a^"x" a:^":" a4:4 c:8 a:16 c:32 a a: a2: \break diff --git a/input/tutorial/orchestral.ly b/input/tutorial/orchestral.ly new file mode 100644 index 0000000000..25a3e416f5 --- /dev/null +++ b/input/tutorial/orchestral.ly @@ -0,0 +1,4 @@ + + + + diff --git a/input/tutorial/sammartini.ly b/input/tutorial/sammartini.ly index b1269e15a4..e0989b66ba 100644 --- a/input/tutorial/sammartini.ly +++ b/input/tutorial/sammartini.ly @@ -1,8 +1,12 @@ \include "paper16.ly"; +stemdown = \property Voice.Stem \override #'direction = #-1 +stemup = \property Voice.Stem \override #'direction = #1 +stemboth = \property Voice.Stem \revert #'direction + viola = \notes \relative c' \context Voice = viola { - \property Voice.verticalDirection = \down g'8. b,16 + \stemdown g'8. b,16 s1 s2. r4 g } @@ -15,7 +19,7 @@ oboes = \notes \relative c'' \context Voice = oboe { \context Voice = oboeTwo { \stemdown \grace { - \property Grace.verticalDirection = \down + \property Grace.Stem \override #'direction = #-1 [f,16 g] } f8 e e2 } > @@ -25,15 +29,12 @@ oboes = \notes \relative c'' \context Voice = oboe { [ < )e8. g>] } -hoomPah = \notes \transpose c' { - c8 \translator Staff = top \stemdown - c'8 \translator Staff = bottom \stemup } - -hoomPahHoomPah = { [\hoomPah \hoomPah] } +hoomPah = \notes \repeat unfold 8 \transpose c' { c8 \stemdown c'8 \stemup } bassvoices = \notes \relative c' { c4 g8. b,16 - \hoomPahHoomPah \hoomPahHoomPah \hoomPahHoomPah \hoomPahHoomPah + \autochange Staff \hoomPah o + \translator Staff = down \stemdown [c8 c'8] r4 r4 < {\stemup r2 } @@ -42,11 +43,11 @@ bassvoices = \notes \relative c' { \score { \context PianoStaff \notes < - \context Staff = top < \time 2/2; - \context Voice = viola \viola + \context Staff = up < \time 2/2; + \viola \oboes > - \context Staff = bottom < \time 2/2; \clef bass; + \context Staff = down < \time 2/2; \clef bass; \bassvoices > > @@ -55,6 +56,3 @@ bassvoices = \notes \relative c' { indent = 0.0; linewidth = 15.0 \cm; } } - - - diff --git a/input/tutorial/singing-saw.ly b/input/tutorial/singing-saw.ly new file mode 100644 index 0000000000..b6080d8579 --- /dev/null +++ b/input/tutorial/singing-saw.ly @@ -0,0 +1,33 @@ + +accompMotif = \notes \relative c { + \times 2/3 { c8 g' es' } + \times 2/3 { c' es, g, } +} + +accomp = \notes \relative c' \autochange Staff { + \autoBeamOff + + r8 d-. + \showStaffSwitch + f, b, + \hideStaffSwitch + \autoBeamOn + \repeat unfold 2 \accompMotif +} +piano = \context PianoStaff \notes < + \context Staff = up < + s1*2 + \accomp + > + \context Staff = down { \clef bass; s1*2 } +> + +saw = \context Staff \notes { + \property Staff.clefOctavation = #7 + r1 b'''2 - \glissando ais'''2 +} + +\score { + < \saw \piano > +} + diff --git a/input/tutorial/wss.ly b/input/tutorial/wss.ly new file mode 100644 index 0000000000..a74b650124 --- /dev/null +++ b/input/tutorial/wss.ly @@ -0,0 +1,8 @@ + +\score { + +\notes {\notes \reletive c' { + \times 2/3 { [fis8 fis8 fis8] } + \times 2/3 { [b b b] } + bes4 +} diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index 5db9f69033..ab240be254 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -7,7 +7,7 @@ */ -#include "auto-change-music.hh" +#include "music.hh" #include "auto-change-iterator.hh" #include "translator-group.hh" #include "musical-request.hh" @@ -123,9 +123,7 @@ Auto_change_iterator::process (Moment m) { where_dir_ = s; String to_id = (s >= 0) ? "up" : "down"; - Auto_change_music const * auto_mus = dynamic_cast (music_l_); - - String wh = ly_scm2string (auto_mus->get_mus_property ("what")); + String wh = ly_scm2string (music_l_->get_mus_property ("what")); change_to (child_iter_p_, wh, to_id); } } diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 5ddad95983..164efb439d 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -30,6 +30,12 @@ Chord_tremolo_iterator::Chord_tremolo_iterator() child_iter_p_ = 0; } +Chord_tremolo_iterator::Chord_tremolo_iterator (Chord_tremolo_iterator const &src) + : Music_iterator (src) +{ + child_iter_p_ = src.child_iter_p_? src.child_iter_p_->clone () : 0; +} + void Chord_tremolo_iterator::process (Moment m) { diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index 71328c87d2..a6126ddcb4 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -37,6 +37,14 @@ Folded_repeat_iterator::~Folded_repeat_iterator () delete alternative_iter_p_; } +Folded_repeat_iterator::Folded_repeat_iterator (Folded_repeat_iterator const &src) + : Music_iterator (src) +{ + main_iter_p_ = src.main_iter_p_ ? src.main_iter_p_->clone () : 0; + alternative_iter_p_ = src.alternative_iter_p_ ? src.alternative_iter_p_->clone () : 0; + main_length_mom_ = src.main_length_mom_; +} + Moment Folded_repeat_iterator::pending_moment () const { @@ -55,7 +63,7 @@ Folded_repeat_iterator::construct_children () main_iter_p_ = get_iterator_p (mus->body ()); if (!main_iter_p_->ok()) { - leave_body (); + leave_body (); enter_alternative (); } } diff --git a/lily/include/auto-change-music.hh b/lily/include/auto-change-music.hh index 0451dd1fba..09c7cfafd0 100644 --- a/lily/include/auto-change-music.hh +++ b/lily/include/auto-change-music.hh @@ -1,25 +1 @@ -/* - auto-change-music.hh -- declare Auto_change_music - - source file of the GNU LilyPond music typesetter - - (c) 1999--2000 Han-Wen Nienhuys - - */ - -#ifndef AUTO_CHANGE_MUSIC_HH -#define AUTO_CHANGE_MUSIC_HH - -#include "music-wrapper.hh" - - -class Auto_change_music : public Music_wrapper -{ -public: - Auto_change_music (SCM); - -}; - - -#endif /* AUTO_CHANGE_MUSIC_HH */ - +#error diff --git a/lily/include/chord-tremolo-iterator.hh b/lily/include/chord-tremolo-iterator.hh index 3ac4d45cfd..7f5e5c4852 100644 --- a/lily/include/chord-tremolo-iterator.hh +++ b/lily/include/chord-tremolo-iterator.hh @@ -18,7 +18,7 @@ public: VIRTUAL_COPY_CONS (Music_iterator); static SCM constructor_cxx_function; Chord_tremolo_iterator (); - + Chord_tremolo_iterator (Chord_tremolo_iterator const & ); protected: virtual ~Chord_tremolo_iterator (); virtual Moment pending_moment () const; diff --git a/lily/include/folded-repeat-iterator.hh b/lily/include/folded-repeat-iterator.hh index 2dba3733c7..178414c7b6 100644 --- a/lily/include/folded-repeat-iterator.hh +++ b/lily/include/folded-repeat-iterator.hh @@ -21,7 +21,8 @@ class Folded_repeat_iterator : public Music_iterator public: VIRTUAL_COPY_CONS (Music_iterator); static SCM constructor_cxx_function; - + + Folded_repeat_iterator (Folded_repeat_iterator const &src); Folded_repeat_iterator (); ~Folded_repeat_iterator (); @@ -39,7 +40,7 @@ protected: private: Music_iterator * main_iter_p_; Music_iterator * alternative_iter_p_; - int count_; + Moment main_length_mom_; }; #endif /* FOLDED_REPEAT_ITERATOR_HH */ diff --git a/lily/include/lyric-combine-music-iterator.hh b/lily/include/lyric-combine-music-iterator.hh index 0f200cad89..dea39fcd91 100644 --- a/lily/include/lyric-combine-music-iterator.hh +++ b/lily/include/lyric-combine-music-iterator.hh @@ -18,6 +18,7 @@ class Lyric_combine_music_iterator : public Music_iterator public: VIRTUAL_COPY_CONS (Music_iterator); Lyric_combine_music_iterator (); + Lyric_combine_music_iterator (Lyric_combine_music_iterator const&src); static SCM constructor_cxx_function; protected: virtual void construct_children (); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 45cf8e3825..24052a3c96 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -160,6 +160,7 @@ public: class Glissando_req : public Request { +public: VIRTUAL_COPY_CONS (Music); }; diff --git a/lily/include/part-combine-music-iterator.hh b/lily/include/part-combine-music-iterator.hh index 61db1ad3ca..4e62ff651c 100644 --- a/lily/include/part-combine-music-iterator.hh +++ b/lily/include/part-combine-music-iterator.hh @@ -22,7 +22,7 @@ public: static SCM constructor_cxx_function; protected: virtual ~Part_combine_music_iterator (); - + Part_combine_music_iterator (Part_combine_music_iterator const &); virtual void construct_children (); virtual Moment pending_moment () const; virtual void process (Moment); diff --git a/lily/include/unfolded-repeat-iterator.hh b/lily/include/unfolded-repeat-iterator.hh index a3c757a381..11b6a8fef3 100644 --- a/lily/include/unfolded-repeat-iterator.hh +++ b/lily/include/unfolded-repeat-iterator.hh @@ -50,7 +50,7 @@ public: SCM alternative_cons_; ~Unfolded_repeat_iterator(); Unfolded_repeat_iterator (); - + Unfolded_repeat_iterator (Unfolded_repeat_iterator const &); protected: virtual void construct_children (); virtual Moment pending_moment () const; diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index 72453e5659..bcff3af02a 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -98,6 +98,13 @@ Lyric_combine_music_iterator::~Lyric_combine_music_iterator () delete music_iter_p_; } +Lyric_combine_music_iterator::Lyric_combine_music_iterator (Lyric_combine_music_iterator const & src) + : Music_iterator (src) +{ + + lyric_iter_p_ = src.lyric_iter_p_ ? src.lyric_iter_p_->clone () : 0; + music_iter_p_ = src.music_iter_p_ ? src.music_iter_p_->clone () : 0; +} Music_iterator* Lyric_combine_music_iterator::try_music_in_children (Music *m) const { diff --git a/lily/moment.cc b/lily/moment.cc index 7b92cdbdcc..9b3080f12d 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -67,7 +67,6 @@ void init_moments () { scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational); - scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational); } ADD_SCM_INIT_FUNC(moms,init_moments); diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index eb05061be1..b0998be9b8 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -19,12 +19,10 @@ Music_iterator::Music_iterator () { - // clone_i_ = 0; } Music_iterator::Music_iterator (Music_iterator const& src) { - // clone_i_ = src.clone_i_ + 1; handle_ = *src.handle_.clone (); music_l_ = src.music_l_; music_length_ = src.music_length_; diff --git a/lily/note-head-line-engraver.cc b/lily/note-head-line-engraver.cc index b2717201cf..2a6336f89d 100644 --- a/lily/note-head-line-engraver.cc +++ b/lily/note-head-line-engraver.cc @@ -20,8 +20,12 @@ /** Create line-spanner grobs for glissandi (and possibly other) lines that connect note heads. - */ + + TODO: have the line commit suicide if the notes are connected with + either slur or beam. + +*/ class Note_head_line_engraver : public Engraver { public: @@ -74,29 +78,23 @@ Note_head_line_engraver::acknowledge_grob (Grob_info info) { if (Rhythmic_head::has_interface (info.elem_l_)) { - last_head_ = head_; head_ = info.elem_l_; if (to_boolean (get_property ("followThread"))) { - Translator* staff = daddy_trans_l_ && daddy_trans_l_->daddy_trans_l_ - ? daddy_trans_l_->daddy_trans_l_->daddy_trans_l_ : 0; - if (staff != last_staff_) + Translator_group * tr = daddy_trans_l_; + while (tr && tr->type_str_ != "Staff") + tr = tr->daddy_trans_l_ ; + + if (tr && tr->type_str_ == "Staff" && tr != last_staff_) { if (last_head_) follow_ = true; - last_staff_ = staff; + last_staff_ = tr; } } } } -static Grob* -beam_l (Grob *h) -{ - if (Grob *s = Rhythmic_head::stem_l (h)) - return Stem::beam_l (s); - return 0; -} void Note_head_line_engraver::create_grobs () @@ -104,36 +102,28 @@ Note_head_line_engraver::create_grobs () if (!line_ && (follow_ || last_req_) && last_head_ && head_ && (last_head_ != head_)) { - /* Don't follow if there's a beam. + /* TODO: Don't follow if there's a beam. - Hmm, this doesn't work, as head_ does not yet have a beam. + We can't do beam-stuff here, since beam doesn't exist yet. Should probably store follow_ in line_, and suicide at some later point */ - if (!(follow_ - && beam_l (last_head_) && beam_l (last_head_) == beam_l (head_))) - { - if (follow_) - line_ = new Spanner (get_property ("FollowThread")); - else - line_ = new Spanner (get_property ("Glissando")); + if (follow_) + line_ = new Spanner (get_property ("FollowThread")); + else + line_ = new Spanner (get_property ("Glissando")); - line_->set_bound (LEFT, last_head_); - line_->set_bound (RIGHT, head_); + line_->set_bound (LEFT, last_head_); + line_->set_bound (RIGHT, head_); /* Note, mustn't set y-parent of breakable symbol to simple item: one of the two broken parts won't have an y-parent! */ /* X parent is set by set_bound */ - line_->set_parent (Staff_symbol_referencer::staff_symbol_l (last_head_), - Y_AXIS); + line_->set_parent (Staff_symbol_referencer::staff_symbol_l (last_head_), + Y_AXIS); - announce_grob (line_, last_req_); - } + announce_grob (line_, last_req_); + last_req_ = 0; - last_head_ = 0; - if (!follow_ && !req_) - head_ = 0; - - last_req_ = 0; follow_ = false; } } @@ -146,8 +136,15 @@ Note_head_line_engraver::stop_translation_timestep () typeset_grob (line_); line_ = 0; } - last_req_ = req_; - req_ = 0; + if (head_) + last_head_ = head_; + head_ = 0; + + if (req_) + { + last_req_ = req_; + req_ =0; + } } diff --git a/lily/parser.yy b/lily/parser.yy index bbfaf2438a..cc62753a21 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -39,9 +39,9 @@ #include "repeated-music.hh" #include "lilypond-input-version.hh" #include "grace-music.hh" -#include "auto-change-music.hh" #include "part-combine-music.hh" #include "scm-hash.hh" +#include "auto-change-iterator.hh" #include "chord.hh" @@ -772,8 +772,9 @@ Composite_music: $$ = csm; } | AUTOCHANGE STRING Music { - Auto_change_music * chm = new Auto_change_music (SCM_EOL); + Music * chm = new Music_wrapper (SCM_EOL); chm->set_mus_property ("element", $3->self_scm ()); + chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function); scm_unprotect_object ($3->self_scm ()); chm->set_mus_property ("what", $2); @@ -1267,6 +1268,9 @@ verbose_request: a->set_spot (THIS->here_input ()); $$ = a; } + /* +duh, junk this syntax from the parser, if possible. + */ | ARPEGGIO { Arpeggio_req *a = new Arpeggio_req; a->set_spot (THIS->here_input ()); diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 235b64452e..526b70ab88 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -28,6 +28,18 @@ Part_combine_music_iterator::~Part_combine_music_iterator () delete first_iter_p_; } +Part_combine_music_iterator::Part_combine_music_iterator (Part_combine_music_iterator const &src) + : Music_iterator (src) +{ + second_iter_p_ = src.second_iter_p_ ? src.second_iter_p_->clone () : 0; + first_iter_p_ = src.first_iter_p_ ? src.first_iter_p_->clone () : 0; + + first_until_ = src.first_until_; + second_until_ = src.second_until_; + state_ = src.state_; + suffix_ = src.suffix_; +} + Moment Part_combine_music_iterator::pending_moment () const { diff --git a/lily/scores.cc b/lily/scores.cc index 3310a88fc4..84e9891994 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -96,7 +96,8 @@ clear_scores () score_global_array.clear(); inclusion_global_array.clear (); - scm_unprotect_object (global_header_p ->self_scm ()); + if (global_header_p) + scm_unprotect_object (global_header_p ->self_scm ()); global_header_p =0; } diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index c8a6fd404d..89e5ba2fc6 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -19,6 +19,17 @@ Unfolded_repeat_iterator::~Unfolded_repeat_iterator () delete current_iter_p_; } +Unfolded_repeat_iterator::Unfolded_repeat_iterator (Unfolded_repeat_iterator const &src) + : Music_iterator (src) +{ + done_count_ = src.done_count_; + current_iter_p_ = (src.current_iter_p_)? src.current_iter_p_->clone () : 0; + do_main_b_ = src.do_main_b_; + volta_b_ = src.volta_b_; + alternative_count_i_ = src.alternative_count_i_; + alternative_cons_ = src.alternative_cons_; +} + Unfolded_repeat_iterator::Unfolded_repeat_iterator () { done_count_ =0; @@ -26,6 +37,7 @@ Unfolded_repeat_iterator::Unfolded_repeat_iterator () volta_b_ = false; do_main_b_ = false; alternative_count_i_ =0; + alternative_cons_ = SCM_EOL; } /** diff --git a/ly/performer.ly b/ly/performer.ly index 4b300caf9f..c3ba784bea 100644 --- a/ly/performer.ly +++ b/ly/performer.ly @@ -43,7 +43,9 @@ ThreadContext = \translator { \name Grace; \consists "Note_performer"; \consists "Tie_performer"; - weAreGraceContext = "1"; + \consists "Swallow_performer"; + + weAreGraceContext = #t } \translator diff --git a/ly/property.ly b/ly/property.ly index 95ba08ca18..028933e231 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -82,11 +82,14 @@ endincipit = \notes{ autoBeamOff = \property Voice.noAutoBeaming = ##t autoBeamOn = \property Voice.noAutoBeaming = ##f - emptyText = \property Voice.textNonEmpty = ##f fatText = \property Voice.textNonEmpty = ##t +showStaffSwitch = \property Thread.followThread = ##t +hideStaffSwitch = \property Thread.followThread = ##f + + % To remove a Volta bracet or some other graphical object, -% set it to turnOff. Example: \property Staff.VoltaBracket = turnOff +% set it to turnOff. Example: \property Staff.VoltaBracket = \turnOff turnOff = #'((meta . ((interfaces . ())))) diff --git a/scm/generate-documentation.scm b/scm/generate-documentation.scm index 9e605e9424..cbc19bae28 100644 --- a/scm/generate-documentation.scm +++ b/scm/generate-documentation.scm @@ -20,8 +20,6 @@ (eval-string (ly-gulp-file "engraver-documentation-lib.scm")) (eval-string (ly-gulp-file "backend-documentation-lib.scm")) - - ;;(define no-copies #t) ; from 490 to 410K, but doesn't look nice yet ;; ;; Also, copies of interfaces use up lots more space, but that's @@ -54,11 +52,30 @@ ("LilyPond context properties" . "context properties") ("LilyPond backend" . "Detailed description of all Grobs") ("LilyPond interfaces" . "Grob Interfaces") - ("LilyPond backend properties" . "Grob properties"))) + ("LilyPond backend properties" . "Grob properties") + ("Index" . "index") + )) doc + + "@node Index +@unnumbered Concept index + +@printindex cp + +@unnumbered Variable index + +@printindex vr + +@unnumbered Function index + +@printindex fn + +" + + "\n@bye") out)) diff --git a/scm/translator-description.scm b/scm/translator-description.scm index 32c66834b7..559aa0bfa0 100644 --- a/scm/translator-description.scm +++ b/scm/translator-description.scm @@ -425,10 +425,10 @@ measurePosition and currentBarNumber to determine what number to print over the 'Note_head_line_engraver (engraver-description "Note_head_line_engraver" - "Engrave a line between two note heads." - '(Glissando FollowThread) - '( - ))) + "Engrave a line between two note heads, for example a glissando. +If followThread is set, staff switches also generate a line." + '(Glissando) + '(followThread))) (cons 'Note_name_engraver diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index e6480c0e77..ea8f9ce871 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -326,8 +326,11 @@ output_dict= { %s } > -\end{lilypond}""", - 'output-lilypond':r"""\begin[%s]{lilypond} +\end{lilypond}""", + 'output-filename' : r''' + +\verb+%s+:''', + 'output-lilypond': r"""\begin[%s]{lilypond} %s \end{lilypond}""", 'output-verbatim': "\\begin{verbatim}%s\\end{verbatim}", @@ -342,6 +345,9 @@ output_dict= { %s @end lilypond """, + 'output-filename' : r''' + +@file{%s}:''', 'output-lilypond-fragment': """@lilypond[%s] \context Staff\context Voice{ %s } @end lilypond """, @@ -630,9 +636,11 @@ def completize_preamble (chunks): read_files = [] def find_file (name): """ - Search the include path for NAME. If found, return the contents of teh file. + Search the include path for NAME. If found, return the (CONTENTS, PATH) of the file. """ + f = None + nm = '' for a in include_path: try: nm = os.path.join (a, name) @@ -643,10 +651,10 @@ def find_file (name): pass if f: sys.stderr.write ("Reading `%s'\n" % nm) - return f.read () + return (f.read (), nm) else: error ("File not found `%s'\n" % name) - return '' + return ('', '') def do_ignore(match_object): return [('ignore', match_object.group('code'))] @@ -677,12 +685,22 @@ def make_lilypond(m): (options, m.group('code')))] def make_lilypond_file(m): + """ + + Find @lilypondfile{bla.ly} occurences and substitute bla.ly + into a @lilypond .. @end lilypond block. + + """ + if m.group('options'): options = m.group('options') else: options = '' + (content, nm) = find_file(m.group('filename')) + options = "filename=%s," % nm + options + return [('input', get_output('output-lilypond') % - (options, find_file(m.group('filename'))))] + (options, content))] def make_lilypond_block(m): if m.group('options'): @@ -752,7 +770,7 @@ def determine_format (str): def read_doc_file (filename): """Read the input file, find verbatim chunks and do \input and \include """ - str = find_file(filename) + (str, path) = find_file(filename) determine_format (str) chunks = [('input', str)] @@ -820,6 +838,15 @@ def schedule_lilypond_block (chunk): if 'png' in needed_filetypes and f(pathbase, '.eps', '.png'): todo.append('png') newbody = '' + + if 'printfilename' in opts: + for o in opts: + m= re.match ("filename=(.*)", o) + if m: + newbody = newbody + get_output ("output-filename") % m.group(1) + break + + if 'verbatim' in opts: newbody = output_verbatim (body) @@ -1033,7 +1060,7 @@ def check_texidoc (chunks): (type, body, opts, todo, basename) = c; pathbase = os.path.join (g_outdir, basename) if os.path.isfile (pathbase + '.texidoc'): - body = '\n@include %s.texidoc' % basename + body + body = '\n@include %s.texidoc\n' % basename + body c = (type, body, opts, todo, basename) n.append (c) return n