From c0ab1a6c80e616c0f041572561e03e0f9e8736e1 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:32:38 +0000 Subject: [PATCH] lilypond-1.3.103 --- Documentation/user/properties.itely | 493 +------------------------ lily/auto-beam-engraver.cc | 109 +++--- lily/music-output-def.cc | 1 + lily/my-lily-parser.cc | 6 +- lily/stem-engraver.cc | 22 +- lily/translator-def.cc | 6 +- ly/generate-documentation.ly | 3 +- scm/generate-backend-documentation.scm | 32 +- scm/generate-documentation.scm | 20 + 9 files changed, 101 insertions(+), 591 deletions(-) create mode 100644 scm/generate-documentation.scm diff --git a/Documentation/user/properties.itely b/Documentation/user/properties.itely index dccdba1b03..6f7adf1c02 100644 --- a/Documentation/user/properties.itely +++ b/Documentation/user/properties.itely @@ -8,254 +8,7 @@ property is listed in parentheses after the property name. @end macro -TODO: - - -@table @samp - @item @code{Generic_property_list} - Defines names and types for generic properties. These are properties - than can be plugged into the backend directly. See the init file - @file{generic-property.scm} for details. For internal use only. - - @item @code{XXXVerticalExtent}@indexcode{groupVerticalExtent} @propertytype{Interval: a cons of numbers} - Hard code the size of the vertical group in context XXX, example -@example -\property Staff.StaffVerticalExtent = #(-5.0 . 5.0) -@end example - The value is a cons of real numbers, that measure the extent in - staff spaces. -@end table - -@subsubheading Lyrics properties - -@cindex properties!Lyrics - -@table @samp - @item @code{textStyle}@indexcode{textStyle} @propertytype{string} - Set the font for lyrics. The available font choices are - @code{roman}, @code{italic}, @code{bold}, @code{large}, @code{Large}, - @code{typewriter}, and @code{finger}. The @code{finger} font can - only display numbers. Note also that you must be careful when - using @code{\property} in Lyrics mode, because of the way strings - are parsed. Either put quotes around the arguments to - @code{\property} or be sure to leave a space on both sides of the - dot. -@end table - -@subsubheading Thread properties - -@cindex properties!Thread - -@table @samp - @item @code{noteHeadStyle}@indexcode{noteHeadStyle} @propertytype{symbol} - Selects type of note head. Choices are @code{'cross}, - @code{'diamond}, @code{'harmonic}, @code{'transparent}, - @code{'mensural}, @code{'baroque}, and @code{'default}. - They are shown in that order below. The @code{'baroque}, - style gives the default symbols except for brevis and - longa notes which are square shaped as in the @code{'mensural} - style. - -@mudela[center,verbatim] - \score { - \notes { - \property Staff.barNonAuto = 1 - \property Voice.noteHeadStyle = #'cross - a' - \property Voice.noteHeadStyle = #'diamond - a' - \property Voice.noteHeadStyle = #'harmonic - a' - \property Voice.noteHeadStyle = #'transparent - a' - \property Voice.noteHeadStyle = #'mensural - a' - \property Voice.noteHeadStyle = #'default - a' - } - \paper { - linewidth = -1.; - } - } - -@end mudela -@end table - -@subsubheading Grace properties - -@cindex properties!Grace - - -@table @samp - @item @code{flagStyle}@indexcode{flagStyle} @propertytype{string} - By default set to @code{"grace"} meaning that all unbeamed - notes with flags are typeset with a slash through the flag. - Setting to @code{""} gives standard flags. - -@mudela[verbatim] -c'8 \property Voice.flagStyle = "grace" c'8 -@end mudela -@end table - - -@subsubheading Voice properties - -@cindex properties!Voice - @table @samp - @item @code{abbrev}@indexcode{abbrev} @propertytype{integer} - Set length for tremolo to be used if no length is explicitly - specified. - - @item @code{articulationScriptPadding}@indexcode{articulationScriptPadding} - Determines the extra space added between articulation marks, such - as staccato, tenuto, trill, up/down bow or fermata, and the - closest staff line or note. - - @item @code{articulationScriptVerticalDirection} @propertytype{direction} - @indexcode{articulationScriptVerticalDirection} - Determines the location of articulation marks. Set to @code{\up} - to print marks above the staff; set to @code{\down} to print marks - below the staff. This property does not override explicit - directions marked with `@code{^}' or `@code{_}' in the mudela file. - - @item @code{noAutoBeaming}@indexcode{beamAuto} @propertytype{boolean} - If set to true then beams are not generated automatically. - - @item @code{beamAutoEnd}@indexcode{beamAutoEnd} @propertytype{?} - Specifies when automatically generated beams can end. See - section XREF-autobeam [FIXME]. - - @item @code{beamAutoBegin}@indexcode{beamAutoBegin} @propertytype{?} - Specifies when automatically generated beams can start. See - section XREF-autobeam [FIXME]. - - -[outdated FIXME] - @item @code{beamQuantisation}@indexcode{beamQuantisation} @propertytype{symbol} - Set to @code{\none} for no quantization. Set to @code{\normal} to - quantize position and slope. Set to @code{\traditional} to avoid - wedges. These three settings are available via - @code{\beamposfree}@keyindex{beamposfree}, - @code{\beamposnormal}@keyindex{beamposnormal}, and - @code{\beampostraditional}@keyindex{beampostraditional}. - - @item @code{beamSlopeDamping}@indexcode{beamSlopeDamping} @propertytype{number} - Set to @code{\none} for undamped beams. Set to @code{\normal} for - damped beams. Set to @code{\infinity} for beams with zero slope. - The identifiers - @code{\beamslopeproportional}@keyindex{beamslopeproportional}, - @code{\beamslopedamped}@keyindex{beamslopedamped}, and - @code{\beamslopezero}@keyindex{beamslopezero} each set the - corresponding value. - - @item @code{dynamicDirection}@indexcode{dynamicDirection} @propertytype{direction} - Determines location of dynamic marks. Set to @code{\up} to print - marks above the staff; set to @code{\down} to print marks below - the staff. - - @item @code{dynamicStyle}@indexcode{dynamicStyle} @propertytype{string} - Set the text style for dynamics. - - @item @code{fontSize}@indexcode{fontSize} @propertytype{number} - Can be used to select smaller font sizes for music. The normal - font size is 0, and the two smaller sizes are -1 - and -2. - -@mudela[verbatim] -c''16 \property Staff.fontSize = -2 c''16 -@end mudela - - @item @code{forceHorizontalShift}@indexcode{forceHorizontalShift} - Force horizontal shift for collision resolution. It overrides - automatic collision resolution. The value is the shift amount - expressed in @code{note_width}, as set in the paper section. - -@item @code{collisionMergeDotted}@indexcode{collisionMergeDotted} @propertytype{boolean} - -Merge noteheads in collisions, even if they have a different number of -dots. This normal notation for polyphonic guitar music. - -@mudelafile[verbatim]{force-hshift.ly} - - -[FIXME: this should be moved] - -Lilypond always arranges note heads on alternate sides of a stem (that -is, within a single voice) as necessary to prevent collisions (note head -overlaps). For up stems, the upper note of a colliding pair is placed -on the right side of the stem, the lower on the left. For down stems, -the algorithm works in reverse. - -Lily also attempts to prevent collisions of note heads in different -voices. A situation where chords of two or more voices are played -simultaneously within one staff. - -By default, if only two voices (and both have opposite stem directions) -are in this 'collision group', the notes both are shifted by @code{0.5 -\quartwidth} if there are unisons or seconds between the voices. - -If there are more than two voices in a collision group, shifting is -inactive by default, since in this case, there are multiple chords with -the same stem direction. By distinguish between those chords, LilyPond -can do collision resolution in these cases as well. - -Distinguishing between voices with the same stem direction, is done by -setting the property @code{Voice.horizontalNoteShift}. It must be set -to a different integer for each voice. Then, all note heads in collision -groups (not just unisons and seconds) will be offset, one voice relative -another. The following fragment of sheet music shows how shifting is -done, with values of @code{horizontalNoteShift} printed over and under -the notes. In this case the chords are just simple notes. - -@c URG : mudela book bug. -@mudela[singleline,verbatim] -\score { - \notes \context Staff < - \context Voice = VA { \stemUp f''4^"0" } - \context Voice = VB {\stemUp - \property Voice.horizontalNoteShift = 1 d''4^" 1" } - \context Voice = VC { \stemUp \property -Voice.horizontalNoteShift = 2 b'4^" 2" } - \context Voice = VD { \stemDown \property -Voice.horizontalNoteShift = 1 g'4_"1 " } - \context Voice = VE { \stemDown e'4_"0" } - > -} -@end mudela - -If you are not satisfied with the collision resolution of LilyPond, you -can override the horizontal shift value of the chord of one Voice, by -setting @code{forceHorizontalShift}. This sets the amount shift, -measured in black note head widths. - -To take complete control of note position shifts in complex passages, -you have set things up for normal collisions and override all shifts by -setting @code{forceHorizontalShift} to zero everywhere -@example -\property Voice.horizontalNoteShift = -\property Voice.forceHorizontalShift = "0.0" -@end example - -Then you can set the force property to a suitable value before each note -that really needs it (unisons and seconds), and reset it to 0.0 after -the note. - - @item @code{horizontalNoteShift}@indexcode{horizontalNoteShift} @propertytype{integer} - Enable LilyPond to shift notes horizontally if they collide with - other notes. This is useful when typesetting many voices on one - staff. The identifier @code{\shift}@keyindex{shift} is defined to - enable this. Traditionally, the outer chords (the upmost and - downmost voices), should have no @code{horizontalNoteShift}. - - @item @code{markScriptPadding}@indexcode{markScriptPadding} @propertytype{number} - Determines the extra space added between the mark and the closest - staff line or note. - - @item @code{markDirection}@indexcode{markDirection} @propertytype{direction} - Determines if marks should be printed above or below the staff. - Set to @code{\up} to print marks above the staff; set to - @code{\down} to print marks below the staff. @item @code{midiInstrument}@indexcode{midiInstrument} @propertytype{string} Sets the instrument for MIDI output. If this property is not set @@ -275,111 +28,15 @@ r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 @end mudela - @item @code{scriptHorizontal}@indexcode{scriptHorizontal} @propertytype{boolean} - Put scripts left or right of note heads. Support for this is - limited. Accidentals will collide with scripts. - - @item @code{slurVerticalDirection}@indexcode{slurVerticalDirection} @propertytype{direction} - Set to @code{\free} for free choice of slur direction, set to - @code{\up} to force slurs up, set to @code{\down} to force slurs - down. The shorthands @code{\slurup}@keyindex{slurup}, - @code{\slurDown}@keyindex{slurDown}, and - @code{\slurBoth}@keyindex{slurBoth} are available. - -@item @code{stemLength}@indexcode{stemLength} - Set length of stems. Unit is `@code{staffspace}/2', so - @code{stemLength} defaults to 7. -@mudela[verbatim] -g''4 \property Voice.stemLength = #14 g4 \property Voice.stemLength = #3 g4 g,,4 -@end mudela - - @item @code{stemLeftBeamCount}@indexcode{stemLeftBeamCount} @propertytype{integer} - Specify the number of beams to draw on the left side of the next - note. Overrides automatic beaming. The value is only used once, - and then it is erased. - - @item @code{stemRightBeamCount}@indexcode{stemRightBeamCount} @propertytype{integer} - Specify the number of beams to draw on the right side of the next - note. Overrides automatic beaming. The value is only used once, - and then it is erased. - - @item @code{tieDash}@indexcode{tieDash} @propertytype{integer} - Set dashing of ties. See also @code{slurDash} - - @item @code{tieVerticalDirection}@indexcode{tieVerticalDirection} @propertytype{direction} - 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. - @item @code{transposing}@indexcode{transposing} @propertytype{integer} Transpose the MIDI output. Set this property to the number of half-steps to transpose by. - @item @code{textEmptyDimension}@indexcode{textEmptyDimension} @propertytype{boolean} - If set to true then text placed above or below the staff is - assumed to have zero width. @code{fatText} and @code{emptyText} -are predefined settings. - -@mudela[verbatim] -c4^"foo" \emptyText c4^"foo" c4 -@end mudela - - @item @code{textStyle}@indexcode{textStyle} @propertytype{string} - Set the text style for superscripts and subscripts. See above - for list of text styles. - - @item @code{textScriptPadding}@indexcode{textScriptPadding} @propertytype{number} - Determines the extra space added between superscripted resp. - subscripted text and the closest staff line or note. - - @item @code{verticalDirection}@indexcode{verticalDirection} @propertytype{direction} - Determines the direction of stems, subscripts, beams, slurs, and - ties. Set to @code{\down} to force them down, @code{\up} to force - them up, or @code{\free} to let LilyPond decide. This can be used - to distinguish between voices on the same staff. The - @code{\stemDown}@keyindex{stemDown}, @code{\stemUp}@keyindex{stemUp}, - and @code{\stemBoth}@keyindex{stemBoth} identifiers set this - property. - - - @item @code{tupletDirection}@indexcode{tupletDirection} @propertytype{direction} - Determines the direction of triplets and other tuplets. Set to - @code{\down} to force them below the staff, @code{\up} to force - them above, or @code{\free} to let LilyPond decide. - - @item @code{tupletBracketVisibility}@indexcode{tupletBracketVisibility} @propertytype{boolean} or @propertytype{symbol} - @item @code{tupletNumberVisibility}@indexcode{tupletNumberVisibility} @propertytype{boolean} or @propertytype{symbol} - - These properties the visibility of the tuplet bracket and its -number respectively. Setting it to false will prevent printing of the -associated element. Setting the property to 'if-no-beam will make it -print only if there is no beam associated with this tuplet bracket. - -@mudelafile[verbatim]{tuplet.ly} - - @item @code{tupletInvisible}@indexcode{tupletInvisible} @propertytype{boolean} - - If set to true, tuplet bracket creation is switched off -entirely. This has the same effect as setting both -@code{tupletNumberVisibility} and @code{tupletBracketVisibility} to -@code{#f}, but as this does not even create elements, this setting -uses less memory and time. @item @code{tupletSpannerDuration} @indexcode{tupletSpannerDuration} @propertytype{moment} -Normally a tuplet bracket is as wide as the -@code{\times} expression that gave rise to it. By setting this -property, you can make brackets last shorter. Example - -@mudela[verbatim,fragment] -\context Voice \times 2/3 { - \property Voice.tupletSpannerDuration = #(make-moment 1 4) - [c8 c c] [c c c] -} -@end mudela - @end table @subsubheading Staff properties @@ -388,73 +45,11 @@ property, you can make brackets last shorter. Example @table @samp - @item @code{barNonAuto}@indexcode{barNonAuto} @propertytype{boolean} - If set to true then bar lines will not be printed - automatically; they must be explicitly created with @code{\bar} - keywords. Unlike with the @code{\cadenza} keyword, measures are - still counted. Bar generation will resume according to that - count if this property is set to zero. - - @item @code{barNumberDirection}@indexcode{barNumberDirection} @propertytype{direction} - Set to @code{\up} or @code{\down} to put bar numbers above or below - the staff. - - @item @code{barNumberScriptPadding}@indexcode{barNumberScriptPadding} - Sets extra space between the bar number and the bar it labels. - - @item @code{barSize}@indexcode{barSize} - Specify the height of the bar lines if it should be different - than the staff height. -@mudela[verbatim] -c1 c1 \property Staff.barSize = 20 c1 c1 -@end mudela - - @item @code{barAtLineStart}@indexcode{barAtLineStart} @propertytype{boolean} - Set to true to produce a bar line after the clef at the start - of each line (but not at the beginning of the music). - - [BROKEN] - - @item @code{clefStyle}@indexcode{clefStyle} @propertytype{string} - Determines how clefs are typeset. If set to @code{transparent}, - the clefs are not printed at all [FIXME], if set to - @code{fullSizeChanges}, clef changes in the middle of a line are - typeset with a full size clef. By default, clef changes are - typeset in smaller size. - - - @item @code{staffSpace}@indexcode{staffLineLeading} @propertytype{number} - Specifies the distance (in points) between lines of the staff. - - @item @code{numberOfStaffLines}@indexcode{numberOfStaffLines} @propertytype{integer} - Specifies the number of staff lines. The default is 5. - - @item @code{postBreakPadding}@indexcode{postBreakPadding} @propertytype{number} - Extra space in points to be added after the clef, time signature - and key signature on the staff. Deprecated, do not use. @item @code{noVoltaBraces}@indexcode{noVoltaBraces} @propertytype{boolean} Set to true to suppress the printing of brackets over alternate endings specified by the command @code{\alternative}. [BROKEN] - - @item @code{barAlways}@indexcode{barAlways} @propertytype{boolean} - If set to true a bar line is drawn after each note. - - @item @code{defaultBarType}@indexcode{defaultBarType} @propertytype{string} - Sets the default type of bar line. See Section XREF-barlines [FIXME] - for a list of available bar types. - - @item @code{instrument}, @code{instr} @propertytype{string} - @indexcode{instrument}@indexcode{instr} - If @code{Instrument_name_engraver} -@cindex Instrument_name_engraver - is - added to the Staff translator, then the @code{instrument} property - is used to label the first line of the staff and the @code{instr} - property is used to label subsequent lines. If the - @code{midiInstrument} property is not set, then @code{instrument} - is used to determine the instrument for MIDI output. @item @code{keyOctaviation}@indexcode{keyOctaviation} @propertytype{boolean} If set to false, then keys are the same in all octaves. If set @@ -466,7 +61,7 @@ c1 c1 \property Staff.barSize = 20 c1 c1 @end example The default value is @code{#f}. Can be set to @code{#t} with - @code{\specialkey} or reset with @code{\normalkey}. + @code{\specialkey} or reset with @code{\normalkey}. [BROKEN] @item @code{timeSignatureStyle}@indexcode{timeSignatureStyle} @propertytype{string} Changes the default two-digit layout for time signatures. The @@ -532,92 +127,6 @@ c1 c1 \property Staff.barSize = 20 c1 c1 @end mudela - @item @code{voltaSpannerDuration}@indexcode{voltaSpannerDuration} @propertytype{moment} - -@end table - -@subsubheading GrandStaff properties - -@cindex properties!GrandStaff - -@table @samp - @item @code{maxVerticalAlign}@indexcode{maxVerticalAlign} @propertytype{number} - Set the maximum vertical distance between staffs. - - @item @code{minVerticalAlign}@indexcode{minVerticalAlign} @propertytype{number} - Set the minimum vertical distance between staffs. -@end table - -@subsubheading Score properties -@cindex properties!Score - - - - -@table @samp - @item @code{skipBars}@indexcode{skipBars} @propertytype{boolean} - Set to 1 to skip the empty bars that are produced by - multimeasure notes and rests. These bars will not appear on the - printed output. Set to zero (the default) to expand multimeasure - notes and rests into their full length, printing the appropriate - number of empty bars so that synchronization with other voices is - preserved. - - @quotation - -@mudela[fragment,verbatim,center] -r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3 - -@end mudela - @end quotation - -@item @code{breakAlignOrder}@indexcode{breakAlignOrder} @propertytype{list of string} - - Defines the order in which prefatory matter (clefs, key signatures) appears, eg. this puts the key signatures after the bar lines: -@example - \property Score.breakAlignOrder = #'( - "Span_bar" - "Breathing_sign" - "Clef_item" - "Staff_bar" - "Key_item" - "Time_signature" - ) -@end example - - -@item @code{timing}@indexcode{timing} @propertytype{boolean} - Keep administration of measure length, position, bar number, etc? -Switch off for cadenzas. - -@item @code{currentBarNumber}@indexcode{currentBarNumber} @propertytype{integer} - Contains the current barnumber. This property is incremented at -every barline. - -@item @code{measurePosition}@indexcode{measurePosition} @propertytype{Moment} - - How much of the current measure (measured in whole notes) have we had? - -@item @code{oneBeat}@indexcode{oneBeat} @propertytype{Moment} - - How long does one beat in the current time signature last? - -@item @code{measureLength}@indexcode{measureLength} @propertytype{Moment} - - How long does one measure in the current time signature last? - -@end table - -@subsubheading ChordNamesVoice properties - -@cindex properties!ChordNamesVoice - -@table @samp - @item @code{chordInversion}@indexcode{chordInversion} @propertytype{boolean} - Determines whether LilyPond should look for chord inversions when - translating from notes to chord names. Set to 1 to find - inversions. The default is 0 which does not look for - inversions. @end table diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 62fa32579a..bdf6aefe10 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -85,35 +85,31 @@ Auto_beam_engraver::do_process_music () void Auto_beam_engraver::consider_end_and_begin (Moment test_mom) { - Moment one_beat = *unsmob_moment( get_property ("beatLength")); + SCM wild = gh_list (ly_symbol2scm ("*"), ly_symbol2scm ("*"), SCM_UNDEFINED); + SCM b = gh_list (ly_symbol2scm ("begin"), SCM_UNDEFINED); + SCM e = gh_list (ly_symbol2scm ("end"), SCM_UNDEFINED); + Moment one_beat = *unsmob_moment( get_property ("beatLength")); int num = *unsmob_moment (get_property("measureLength")) / one_beat; int den = one_beat.den_i (); - - String time_str = String ("time") + to_str (num) + "_" + to_str (den); - - String type_str; - if (test_mom.num () != 1) - type_str = to_str (test_mom.num ()); - if (test_mom.den () != 1) - type_str = type_str + "_" + to_str (test_mom.den ()); + SCM time = gh_list (gh_int2scm (num), gh_int2scm (den), SCM_UNDEFINED); - /* - URG - - FIXME: SHOULD USE ALIST - - */ + SCM type = gh_list (gh_int2scm (test_mom.num_i ()), + gh_int2scm (test_mom.den_i ()), SCM_UNDEFINED); + // fixme + SCM settings = scm_eval2 (ly_symbol2scm ("auto-beam-settings"), SCM_EOL); + /* Determine end moment for auto beaming (and begin, mostly 0==anywhere) In order of increasing priority: - i. every beat - ii. time_beamAutoEnd - iii. time_beamAutoEnd - iv. beamAutoEnd - v. beamAutoEnd + i. every beat + ii. end * + iii. end + + iv. end * * * + v. end * * Rationale: @@ -127,8 +123,16 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) iv. generic override v. override for specific duration type - The user overrides should be required for common cases. - */ + */ + + + + // + // + // FIXME: arg: why all these guesses in reverse order? + // + // + /* first guess: begin beam at any position @@ -146,54 +150,47 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) /* second guess: property generic time exception */ - SCM begin = get_property ((time_str + "beamAutoBegin").ch_C()); - if (unsmob_moment (begin)) - begin_mom = * unsmob_moment (begin); + SCM begin = gh_assoc (gh_append3 (b, wild, time), settings); + + if (begin != SCM_BOOL_F && unsmob_moment (gh_cdr (begin))) + begin_mom = * unsmob_moment (gh_cdr (begin)); - SCM end = get_property ((time_str + "beamAutoEnd").ch_C()); - if (unsmob_moment (end)) - end_mom = * unsmob_moment (end); + SCM end = gh_assoc (gh_append3 (e, wild, time), settings); + if (end != SCM_BOOL_F && unsmob_moment (gh_cdr (end))) + end_mom = * unsmob_moment (gh_cdr (end)); /* third guess: property time exception, specific for duration type */ - if (type_str.length_i ()) - { - SCM end_mult = get_property ((time_str + "beamAutoEnd" + type_str).ch_C()); - if (unsmob_moment (end_mult)) - end_mom = * unsmob_moment (end_mult); - - SCM begin_mult = get_property ((time_str + "beamAutoBegin" + type_str).ch_C()); - if (unsmob_moment (begin_mult)) - begin_mom = * unsmob_moment (begin_mult); - } + SCM begin_mult = gh_assoc (gh_append3 (b, type, time), settings); + if (begin_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (begin_mult))) + begin_mom = * unsmob_moment (gh_cdr (begin_mult)); + + SCM end_mult = gh_assoc (gh_append3 (e, type, time), settings); + if (end_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (end_mult))) + end_mom = * unsmob_moment (gh_cdr (end_mult)); /* fourth guess [user override]: property plain generic */ - begin = get_property ("beamAutoBegin"); - if (unsmob_moment (begin)) - begin_mom = * unsmob_moment (begin); + begin = gh_assoc (gh_append3 (b, wild, wild), settings); + if (begin != SCM_BOOL_F && unsmob_moment (gh_cdr (begin))) + begin_mom = * unsmob_moment (gh_cdr (begin)); - - - end = get_property ("beamAutoEnd"); - if (unsmob_moment (end)) - end_mom = * unsmob_moment (end); + end = gh_assoc (gh_append3 (e, wild, wild), settings); + if (end != SCM_BOOL_F && unsmob_moment (gh_cdr (end))) + end_mom = * unsmob_moment (gh_cdr (end)); /* fifth guess [user override]: property plain, specific for duration type */ - if (type_str.length_i ()) - { - SCM end_mult = get_property ((String ("beamAutoEnd") + type_str).ch_C()); - if (unsmob_moment (end_mult)) - end_mom = * unsmob_moment (end_mult); - - SCM begin_mult = get_property ((String ("beamAutoBegin") + type_str).ch_C()); - if (unsmob_moment (begin_mult)) - begin_mom = * unsmob_moment (begin_mult); - } + begin_mult = gh_assoc (gh_append3 (b, type, wild), settings); + if (begin_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (begin_mult))) + begin_mom = * unsmob_moment (gh_cdr (begin_mult)); + + end_mult = gh_assoc (gh_append3 (e, type, wild), settings); + if (end_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (end_mult))) + end_mom = * unsmob_moment (gh_cdr (end_mult)); Rational r; if (end_mom) diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index d2ddb4a9af..bd8fd57ff3 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -91,3 +91,4 @@ Music_output_def::get_default_output () const } + diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index d4fa575511..a44e3c6d45 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -22,7 +22,7 @@ My_lily_parser::My_lily_parser (Sources * source_l) default_duration_.durlog_i_ = 2; error_level_i_ = 0; - fatal_error_i_ = 0; + default_header_p_ =0; } @@ -77,8 +77,6 @@ void My_lily_parser::parser_error (String s) { here_input().error (s); - if (fatal_error_i_) - exit (fatal_error_i_); error_level_i_ = 1; exit_status_i_ = 1; } @@ -124,7 +122,7 @@ My_lily_parser::paper_description () for (SCM s = al ; gh_pair_p (s); s = gh_cdr (s)) { Translator_def * td = unsmob_translator_def (gh_cdar (s)); - l = gh_cons (td->to_alist (), l); + l = gh_cons (gh_cons (gh_caar (s), td->to_alist ()), l); } return l; } diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 5707d843b4..f348697f55 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -27,13 +27,11 @@ public: Stem_engraver(); protected: - virtual void do_creation_processing (); virtual void acknowledge_element (Score_element_info); virtual void do_pre_move_processing (); virtual bool do_try_music (Music*); private: - int default_tremolo_type_i_; Score_element *stem_p_; Score_element *tremolo_p_; Rhythmic_req *rhythmic_req_l_; @@ -47,22 +45,9 @@ Stem_engraver::Stem_engraver () tremolo_req_l_ = 0; stem_p_ = 0; tremolo_p_ = 0; - default_tremolo_type_i_ = 16; rhythmic_req_l_ =0; } -void -Stem_engraver::do_creation_processing () -{ - /* - huh, why only at creation time? - */ - SCM prop = get_property ("tremoloFlags"); - if (gh_number_p(prop)) - { - default_tremolo_type_i_ = gh_scm2int (prop); - } -} void Stem_engraver::acknowledge_element(Score_element_info i) @@ -96,10 +81,11 @@ Stem_engraver::acknowledge_element(Score_element_info i) the first and last (quarter) note bothe get one tremolo flag. */ int requested_type = tremolo_req_l_->type_i_; - if (!requested_type) - requested_type = default_tremolo_type_i_; + SCM f = get_property ("tremoloFlags"); + if (!requested_type && gh_number_p (f)) + requested_type = gh_scm2int (f); else - default_tremolo_type_i_ = requested_type; + daddy_trans_l_->set_property ("tremoloFlags", gh_int2scm (requested_type)); if (requested_type) { diff --git a/lily/translator-def.cc b/lily/translator-def.cc index 3a9cc88de9..668d5a70ea 100644 --- a/lily/translator-def.cc +++ b/lily/translator-def.cc @@ -308,13 +308,13 @@ Translator_def::default_child_context_name () SCM Translator_def::to_alist ()const { - SCM l = SCM_EOL; - + SCM l = SCM_EOL; + l = gh_cons (gh_cons (ly_symbol2scm ("consists"), consists_name_list_), l); l = gh_cons (gh_cons (ly_symbol2scm ("end-consists"), end_consists_name_list_), l); l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), accepts_name_list_), l); l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("type-name"), type_name_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("type-name"), type_name_), l); // junkme. l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l); return l; diff --git a/ly/generate-documentation.ly b/ly/generate-documentation.ly index 924715843e..03399af21a 100644 --- a/ly/generate-documentation.ly +++ b/ly/generate-documentation.ly @@ -1,3 +1,2 @@ -#(eval-string (ly-gulp-file "generate-engraver-documentation.scm")) -#(eval-string (ly-gulp-file "generate-backend-documentation.scm")) +#(eval-string (ly-gulp-file "generate-documentation.scm")) diff --git a/scm/generate-backend-documentation.scm b/scm/generate-backend-documentation.scm index a2f445ac78..70b2f24bba 100644 --- a/scm/generate-backend-documentation.scm +++ b/scm/generate-backend-documentation.scm @@ -89,7 +89,7 @@ (outname (string-append name ".html")) (out (open-output-file outname)) ) - (display (string-append "Writing " outname " ... \n") (current-error-port)) + (writing-wip outname) (display (string-append "LilyPond Element " name " " "

" name "

" @@ -102,24 +102,24 @@ (define (document-elements elts) (let* ((files (map (lambda (x) (document-element (car x) (cdr x))) elts)) + (names (map car elts)) (outname (string-append "backend.html")) (out (open-output-file outname)) - (l (map (lambda (x) (string-append - "
  • " x "\n")) - files)) + (l (map (lambda (x) (string-append "
  • " + (urlfy x))) names)) ) - - (display - (string-append - "LilyPond backend documentation" - "

    LilyPond backend documentation

    " - "
      " - (apply string-append l) - "
    " - ) - out - ) - )) + (writing-wip outname) + (display + (string-append + "LilyPond backend documentation" + "

    LilyPond backend documentation

    " + "
      " + (apply string-append l) + "
    " + ) + out + ) + )) ; (display (document-interface stem-interface '())) ; (define b (cdr (assoc 'Dyna all-element-descriptions))) diff --git a/scm/generate-documentation.scm b/scm/generate-documentation.scm new file mode 100644 index 0000000000..14db4f9ce8 --- /dev/null +++ b/scm/generate-documentation.scm @@ -0,0 +1,20 @@ + + +(define (urlfy x) + (string-append "" x "")) + +(define (human-listify l) + (cond + ((null? l) "none") + ((null? (cdr l)) (car l)) + ((null? (cddr l)) (string-append (car l) " and " (cadr l))) + (else (string-append (car l) ", " (human-listify (cdr l)))) + )) + + +(define (writing-wip x) + (display (string-append "Writing " x " ... \n") (current-error-port)) + ) + +(eval-string (ly-gulp-file "generate-engraver-documentation.scm")) +(eval-string (ly-gulp-file "generate-backend-documentation.scm")) -- 2.39.5