From: hanwen Date: Mon, 30 Jun 2003 10:49:43 +0000 (+0000) Subject: * scripts/convert-ly.py (FatalConversionError.conv): conversion X-Git-Tag: release/1.7.25~75 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7e7b6a698139b8079704217e5ae48f3e05277399;p=lilypond.git * scripts/convert-ly.py (FatalConversionError.conv): conversion rule for automaticBars. * lily/timing-engraver.cc (start_translation_timestep): change barNonAuto to automaticBars --- diff --git a/ChangeLog b/ChangeLog index 583dac9e8f..93d1468f6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-06-30 Han-Wen Nienhuys + + * scripts/convert-ly.py (FatalConversionError.conv): conversion + rule for automaticBars. + + * lily/timing-engraver.cc (start_translation_timestep): change + barNonAuto to automaticBars + 2003-06-30 Graham Percival * input/test/perform-tie.ly: delete file. @@ -11,6 +19,11 @@ 2003-06-29 Han-Wen Nienhuys + * scm/new-markup.scm (brew-new-markup-molecule): move old markup + glue into brew-new-markup-molecule. + + * input/mutopia/J.S.Bach/Petites-Preludes/*.ly: syntax updates. + * Documentation/user/introduction.itely (Computerized typography): new section diff --git a/Documentation/user/cheatsheet.itely b/Documentation/user/cheatsheet.itely index 8508c01606..98b502447b 100644 --- a/Documentation/user/cheatsheet.itely +++ b/Documentation/user/cheatsheet.itely @@ -225,6 +225,14 @@ a-\> a a-\! \times 2/3 { f8 g a } @end lilypond + +@item @code{\grace} +@tab grace notes +@tab +@lilypond[relative 1,fragment] + \grace b16 c4 +@end lilypond + @item @code{\lyrics @{ @dots{} @}} @tab entering lyrics @tab @@ -255,5 +263,17 @@ a-\> a a-\! \context ChordNames \chords { c:dim f:maj7 } @end lilypond +@item @code{< @dots{} \\ @dots{} >} +@tab polyphony +@tab +@lilypond[fragment,relative 1] + < c \\ g' > +@end lilypond + + +@item @code{s4 s8 s16} +@tab spacer rests +@tab + @end multitable diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index d30b5f84bc..6cb8210c4a 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1503,7 +1503,7 @@ voices in the same staff share accidentals, but staves do not. immediately, and if @var{lazyness} is @code{#t} then the accidental lasts forever. -[TODO: should use +infinity for this case?] +@c [TODO: should use +infinity for this case?] @end table @@ -3068,7 +3068,7 @@ next one. Such a line is called an extender line, and it is entered as @refbugs -The definition of lyrics mode is too complex. +The definition of lyrics mode is too complex. @node The Lyrics context @subsection The Lyrics context @@ -3137,7 +3137,8 @@ An example of a SATB score setup is in the file @refbugs @code{\addlyrics} is not automatic enough: melismata are not detected -automatically, and melismata are not stopped when they hit a rest. +automatically, and melismata are not stopped when they hit a rest. A +melisma on the last note in a melody is not printed. @node More stanzas diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 77c85f8f04..8bf2376cf3 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -769,8 +769,16 @@ of music is multiplied by the fraction. Triplets make notes occupy \times 2/3 { c r c } @end lilypond +Grace notes are also made by prefixing a note, or a set of notes with +a keyword. In this case, the keyword is @code{\grace}. +@lilypond[relative 1, verbatim,fragment] + \grace b16-( c4-) + \grace { d16-( e } d4-) +@end lilypond + +@noindent +More information on the use of grace notes is in @ref{Grace notes}. -TODO: grace notes Comments are pieces of the input that are ignored. There are two types of comments. A line comments are introduced by @code{%}: after @@ -850,7 +858,7 @@ line}. It is entered as two underscores, i.e., @example \lyrics @{ I want to break free __ @} @end example -@lilypond[singleline] +@lilypond[] \score { \notes { \addlyrics @@ -858,15 +866,17 @@ line}. It is entered as two underscores, i.e., \partial 8 c8 \times 2/3 { f g g } \times 2/3 { g4-( a2-) } + + %% ugh, this is to deal with bugs in the extender implementation + \blankNotes + c8 } \context Lyrics \lyrics { I want to break free __ } } - \paper{ } + \paper{ linewidth = 9.0 \cm } } @end lilypond -TODO: fix extender lines here. - Similarly, hyphens between words can be entered as two dashes, resulting in a centered hyphen between two syllables. @example @@ -1057,8 +1067,18 @@ voices with @code{\\}: { r4 g4 f2 f4 } > @end lilypond The notation @code{< .. >} is a shorthand for @code{\simultaneous @{ -.. @}}. More features of polyphonic typesetting are in the notation -manual, @ref{Polyphony}. +.. @}}. + +For polyphonic typesetting spacer rests can also be convenient: these +are rests that do not print. It is useful for filling up voices that +temporarily do not play: +@lilypond[verbatim,relative] + < { a4 g2 f4-~ f4 } \\ + { s4 g4 f2 f4 } > +@end lilypond + +More features of polyphonic typesetting are in the notation manual +in @ref{Polyphony}. @node Piano staffs @section Piano staffs @@ -1067,6 +1087,34 @@ manual, @ref{Polyphony}. @cindex cross staff voice, manual @cindex @code{\translator} +Piano music is always typeset in two staffs connected by a brace. +Printing such a staff is done similar to the polyphonic example in +@ref{More basics}: +@example + < \context Staff = up @{ @dots{} @} + \context Staff = down @{ @dots{} @} + > +@end example +but now this entire expression must be interpreted as a +@code{PianoStaff}: +@example + \context PianoStaff < \context Staff @dots{} > +@end example + +Here is a complete-fledged example: +@lilypond[relative 0,fragment] +\context PianoStaff + < \context Staff = up { + c4 c g g } + \context Staff = down { + \clef bass c, c' e c } + > +@end lilypond + +More information on formatting piano music is in @ref{Piano music}. + +@node Setting variables +@section Setting variables @@ -1089,51 +1137,6 @@ number is also used by the @code{convert-ly} program (See version automatically. -@separate -@example -s1 s2. r4 -@end example -@code{s} is a spacer rest. It does not print anything, but it does have -the duration of a rest. It is useful for filling up voices that -temporarily do not play. In this case, the viola does not come until one -and a half measure later. - -@separate -@example -\grace <>-( <>4-) <>2 -@end example -@cindex @code{\grace} -@cindex ornaments -@cindex grace notes -@code{\grace} introduces grace notes. It takes one argument, in this -case a chord. A slur is introduced starting from the @code{\grace} -ending on the following chord. - -@separate -@example -\times 2/3 -@end example -@cindex tuplet -@cindex triplets - -@separate -@example -@{ <>8 <> <> @} -@end example -The piece of music to be `tripletted' is sequential music containing -three chords. - - -The bass has a little hoom-pah melody to demonstrate parts switching -between staves. Since it is repetitive, we use repeats: -@separate -@example -hoomPah = \repeat unfold 8 -@end example -@cindex unfolded @code{\repeat} -The unfolded repeat prints the notes in its argument as if they were -written out in full eight times. -@separate @node Fine tuning a piece @section Fine tuning a piece diff --git a/VERSION b/VERSION index 07626bf35f..40d1c8c559 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=7 -PATCH_LEVEL=22 +PATCH_LEVEL=23 MY_PATCH_LEVEL= # Use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly index 2b7205e87f..8039e44a40 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly @@ -26,7 +26,6 @@ upstaff = \translator "Staff" = "upper" % upper = \context Staff \notes\relative c { upper = \context Staff=upper \notes\relative c { - \context Voice=i \property Voice.TextScript \set #'font-style = #'italic r16 g'' c e r g, c e @@ -51,7 +50,6 @@ upper = \context Staff=upper \notes\relative c { <>4 r4 - \stemBoth \lowstaff \stemUp r16 g,, b d @@ -83,30 +81,26 @@ upper = \context Staff=upper \notes\relative c { b d b g as f g d es fis a c < - { \stemUp r c8 b16 } - \context Voice=ii { \stemDown d,8 f } + { r c8 b16 } \\ + { d,8 f } > - \stemBoth | <>1 \bar "|." } -% lower = \context Staff \notes\relative c{ lower = \context Staff=lower \notes\relative c{ - \context Voice=i \property Voice.TextScript \set #'font-style = #'roman - c4 e g^#'(music "accidentals-1") -\mordent g,4 | - d'4-\mordent f a-\mordent^#'(music "accidentals-1") a,4 | + c4 e g^\markup { \musicglyph #"accidentals-1" } -\mordent g,4 | + d'4-\mordent f a-\mordent^\markup { \musicglyph #"accidentals-1" } a,4 | e' e'-\mordent a, b-\upprall | c4 e, fis gis-\upprall | a4 c, d e-\upprall | f4 e d-\prall c | - g'-\mordent^#'(music "accidentals-1") g, g'-\mordent g, | + g'-\mordent^\markup { \musicglyph #"accidentals-1" } g, g'-\mordent g, | g'-\mordent g, g'-\mordent g, | g' r s s | s s s s \clef "bass" | - < - { \stemUp\tieUp g1 ~ g ~ g ~ g ~ g ~ g ~ g } - \context Voice=ii { \stemDown\tieDown g,1 ~ g ~ g ~ g ~ g ~ g ~ g } + < { g1 ~ g ~ g ~ g ~ g ~ g ~ g } \\ + { g,1 ~ g ~ g ~ g ~ g ~ g ~ g } > <>1 \bar "|." diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly index 0f8ecba68c..8c03af5a3c 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly @@ -17,8 +17,8 @@ upper = \context Staff \notes\relative c{ <>2 r4 <> - < { \stemUp d8-[ g, 8 b d] } - \context Voice = ii < \stemDown b g > + < { d8-[ g, 8 b d] } \\ + { << b g >> } > <>4 @@ -26,10 +26,10 @@ upper = \context Staff \notes\relative c{ c2 r4 < - { \stemUp\tieUp c ~ c8} + { c ~ c8} \\ % We get a warning: No ties created! % but they are too! - \context Voice=ii { \stemDown\tieDown <>4 ~ <>8 } + { <>4 ~ <>8 } > \stemBoth d, fis a fis d c' a | @@ -49,10 +49,9 @@ upper = \context Staff \notes\relative c{ } lower = \context Staff \notes\relative c{ - \context Voice=i < - { \stemUp\tieUp c1 ~ | c ~ | c } - \context Voice=ii { \stemDown\tieDown c,1 ~ | c ~ | c } + { c1 ~ | c ~ | c } \\ + { c,1 ~ | c ~ | c } > \stemBoth | r8 c e g e c c' e, | @@ -60,7 +59,7 @@ lower = \context Staff \notes\relative c{ g2 r4 g | a8 a, c e c a g' e | fis2 r4 d | - g-\mordent-#'(music "accidentals-1") g, 4 g'-\mordent g, | + g-\mordent-\markup { \musicglyph #"accidentals-1" } g, 4 g'-\mordent g, | % mordents in brackets... g'-\mordent g, g'-\mordent g, | g'-\mordent g, g'-\mordent g, | diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly index 29b36d39f6..9cd5cebe5e 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly @@ -97,11 +97,11 @@ two = \context Staff \notes\relative c % \translator Staff=lower \stemUp \context Staff < { - \translator Staff = lower + \translator Staff = lower a8 g fis16 e fis d }\\ { - \translator Staff = upper + \translator Staff = upper d8 a~ a4 } > diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly index 809dadd111..dc9bb1aed6 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly @@ -26,13 +26,12 @@ upper = \context Staff \notes\relative c { \property Voice.TextScript \set #'font-style = #'roman - c4-\mordent^#'(music "accidentals-1") r r | - c4-\mordent^#'(music "accidentals-1") r r + c4-\mordent^\markup { \musicglyph "accidentals-1" } r r | + c4-\mordent^\markup { \musicglyph "accidentals-1" } r r \property Voice.TextScript \set #'font-style = #'italic } \\ - { \stemDown a4 r r | a4 r r } + { a4 r r | a4 r r } > | - \stemBoth a'8 es d c bes a | g fis e! d c' a | %15 @@ -50,7 +49,6 @@ upper = \context Staff \notes\relative c }\\ { \stemDown a4 } > - \stemBoth a8 e' cis a bes! a | g e' cis g e' cis | g e' cis g a g | @@ -91,7 +89,6 @@ upper = \context Staff \notes\relative c } \\ { cis2 } > - \stemBoth d8 c! a d bes g | %45 c a fis bes g e | @@ -122,7 +119,7 @@ lower = \context Staff \notes\relative c{ fis,4 r r d fis d | \property Voice.TextScript \set #'font-style = #'roman - g4-\mordent^#'(music "accidentals-1") r r8 f!8 | + g4-\mordent^\markup { \musicglyph "accidentals-1" } r r8 f!8 | \property Voice.TextScript \set #'font-style = #'italic e4-\prall r r | f4-\mordent r r8 e | diff --git a/input/test/boxed-molecule.ly b/input/test/boxed-molecule.ly index 308cadf8cd..6fb994c055 100644 --- a/input/test/boxed-molecule.ly +++ b/input/test/boxed-molecule.ly @@ -12,7 +12,7 @@ TODO: circled molecules. \score { \notes \relative c'' { \property Voice.TextScript \override #'molecule-callback = - #(make-molecule-boxer 0.1 0.3 0.2 Text_item::brew_molecule) + #(make-molecule-boxer 0.1 0.3 0.2 brew-new-markup-molecule) c'4^"foo" @@ -20,8 +20,7 @@ TODO: circled molecules. #(make-molecule-boxer 0.05 0.25 0.25 Stem::brew_molecule) \property Score.RehearsalMark \override #'molecule-callback = - #(make-molecule-boxer 0.15 0.3 0.3 Text_item::brew_molecule) - + #(make-molecule-boxer 0.15 0.3 0.3 brew-new-markup-molecule) c8 \property Voice.Stem \revert #'molecule-callback diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 64bf816592..25ca7a65b9 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -83,7 +83,7 @@ Extender_engraver::try_music (Music* r) return false; req_ = r; - return true; + return true; } void diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index ed8ff27d7b..40dcbca846 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -79,9 +79,6 @@ Instrument_name_engraver::create_text () if (text_->get_grob_property ("text") != txt) text_->set_grob_property ("text", txt); - if (new_markup_p (txt)) - text_->set_grob_property ("molecule-callback", new_markup_brewer()); - if (delim_) text_->set_parent (delim_, Y_AXIS); diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 0fafc40ae3..bdd968df60 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -128,13 +128,10 @@ Mark_engraver::process_music () */ SCM m = mark_req_->get_mus_property ("label"); - if (new_markup_p (m)) + if (gh_pair_p (m) || new_markup_p (m)) { text_->set_grob_property ("text",m); - text_->set_grob_property ("molecule-callback", new_markup_brewer ()); } - if (gh_pair_p (m)) // markup text - text_->set_grob_property ("text",m); else { if (!gh_string_p (m) && !gh_number_p (m)) diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 46e029e79b..fe64b4473d 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -116,9 +116,6 @@ Text_engraver::process_acknowledged_grobs () SCM mark = r->get_mus_property ("text"); - if (new_markup_p (mark)) - text->set_grob_property ("molecule-callback", new_markup_brewer()); - text->set_grob_property ("text", mark); announce_grob (text, r->self_scm ()); texts_.push (text); diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index 5456a6820a..b289b95239 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -42,7 +42,7 @@ Timing_engraver::start_translation_timestep () { Timing_translator::start_translation_timestep (); - SCM nonauto = get_property ("barNonAuto"); + SCM automatic_bars = get_property ("automaticBars"); Moment now = now_mom (); SCM which = get_property ("whichBar"); @@ -63,7 +63,7 @@ Timing_engraver::start_translation_timestep () ->set_grob_property ("measure-length", mlen.smobbed_copy ()); } - if (!gh_string_p (which) && !to_boolean (nonauto)) + if (!gh_string_p (which) && to_boolean (automatic_bars)) { SCM always = get_property ("barAlways"); @@ -95,5 +95,5 @@ ENTER_DESCRIPTION (Timing_engraver, /* creats*/ "", /* accepts */ "", /* acks */ "", -/* reads */ "timeSignatureFraction barNonAuto whichBar barAlways defaultBarType skipBars timing oneBeat measureLength measurePosition currentBarNumber", +/* reads */ "timeSignatureFraction automaticBars whichBar barAlways defaultBarType skipBars timing oneBeat measureLength measurePosition currentBarNumber", /* write */ ""); diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 1207c714b1..d4ac28c8e1 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -444,7 +444,8 @@ ScoreContext = \translator { defaultBarType = #"|" barNumberVisibility = #default-bar-number-visibility - + automaticBars = ##t + explicitClefVisibility = #all-visible explicitKeySignatureVisibility = #all-visible autoBeamSettings = #default-auto-beam-settings diff --git a/python/lilylib.py b/python/lilylib.py index ca8c97ad86..996277fb22 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -398,8 +398,6 @@ def get_bbox (filename): def make_ps_images (ps_name, resolution = 90): - - ## todo: ## have better algorithm for deciding when to crop page, ## and when to show full page diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index dcdf425c59..ac2be605e1 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -419,7 +419,7 @@ )) (self-alignment-Y . 0) - (molecule-callback . ,Text_item::brew_molecule) + (molecule-callback . ,brew-new-markup-molecule) (break-align-symbol . instrument-name) (break-visibility . ,begin-of-line-visible) (baseline-skip . 2) diff --git a/scm/define-translator-properties.scm b/scm/define-translator-properties.scm index e659ff3d7b..ebaf47bc07 100644 --- a/scm/define-translator-properties.scm +++ b/scm/define-translator-properties.scm @@ -105,7 +105,7 @@ set, \\addlyrics will assume that beams, slurs and ties signal melismata, and align lyrics accordingly. ") -(translator-property-description 'barAlways boolean? " If set to true a bar line is drawn after each note. +(translator-property-description 'barAlways boolean? "If set to true a bar line is drawn after each note. ") (translator-property-description 'barCheckSynchronize boolean? "If true then reset measurePosition when finding a barcheck. Turn off when diff --git a/scm/new-markup.scm b/scm/new-markup.scm index 248047def9..e78ef4184e 100644 --- a/scm/new-markup.scm +++ b/scm/new-markup.scm @@ -658,17 +658,16 @@ against SIGNATURE, reporting MAKE-NAME as the user-invoked function. (define-public (brew-new-markup-molecule grob) (let* - ((t (ly:get-grob-property grob 'text)) - ) - (if (null? t) - '() + ((t (ly:get-grob-property grob 'text))) + (if (markup? t) (interpret-markup grob (Font_interface::get_property_alist_chain grob) t - )) - )) + ) + (Text_item::text_to_molecule t) + ))) -(define-public empty-markup `(,simple-markup "")) +(define-public empty-markup (make-simple-markup "")) (define (interpret-markup grob props markup) (if (string? markup) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 9093b73f05..8323d21d12 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1210,6 +1210,22 @@ if 1: conversions.append (((1,7,22), conv,"remove GraceContext")) +if 1: + def conv(str): + str = re.sub ( + "barNonAuto *= *##t", + "automaticBars = ##f", + str) + str = re.sub ( + "barNonAuto *= *##f", + "automaticBars = ##t", + str) + return str + + conversions.append (((1,7,23), conv,"barNonAuto -> automaticBars")) + + + ################################ # END OF CONVERSIONS ################################ diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index fb662e3576..fa1c65f8bc 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1238,7 +1238,7 @@ linking to the menu. ly.system ('%s --preview --postscript --verbose %s ' % (ly2dvi_binary, base) ) - ly.make_page_images (base) + ly.make_ps_images (base) ly.system ('gzip -9 - < %s.ps > %s.ps.gz' % (base, base)) def size_str (fn): @@ -1380,7 +1380,7 @@ def compile_all_files (chunks): ly.system ("dvips -E -o %s.eps %s" % (file, file)) map (to_eps, eps) - map (lambda x: ly.make_ps_images (x + '.eps'), png) + map (ly.make_ps_images, map (lambda x: x + '.eps', png)) os.chdir (d) diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index d904620154..c837dcb397 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -889,8 +889,8 @@ if 1: for score in find_tex_files (files, extra_init): preview_base = ly.strip_extension (score[0], '.tex') ly.make_ps_images (preview_base + '.preview.ps', - resolution=preview_resolution - ) + resolution=preview_resolution + ) if 'PDFTEX' in targets: try: