From: Han-Wen Nienhuys Date: Mon, 8 Feb 1999 10:08:29 +0000 (+0100) Subject: release: 1.1.28 X-Git-Tag: release/1.1.28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=622b379cd71af8dde94f68135a489b2536309e6f;p=lilypond.git release: 1.1.28 --- diff --git a/Documentation/tex/lilypond-overview.doc b/Documentation/tex/lilypond-overview.doc index 885faa6727..eae2c17b7c 100644 --- a/Documentation/tex/lilypond-overview.doc +++ b/Documentation/tex/lilypond-overview.doc @@ -12,6 +12,8 @@ \begin{document} \maketitle +[THIS IS WORK IN PROGRESS. THIS PAPER IS NOT FINISHED] + % -*-LaTeX-*- \section{Introduction} diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index f84468dc12..6cad45cc87 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -7,11 +7,11 @@ redef(var)(1)(whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(})) redef(code)(1)(tt(ARG1)) + COMMENT( TODO: the use of semicolons needs to be documented once it settles down - \times needs documentation with examples somewhere once it works (?) paper size? the explanation of how lyrics mode parses words seems ridiculous. Is there a simple way to explain this, or is the behavior @@ -22,15 +22,39 @@ TODO: accordion symbols extender* (see extender.ly) \repeat & \alternative -> probably should have an example + properties: + unfoldRepeats + voltaVisibility + property: stemLeftBeamCount stemRightBeamCount + interstaff beams (beam-interstaff.ly) + interstaff slurs (see preludes-1.ly) + boolean property barAuto + property: noteheadStyle + harmonics: test/harmonics.fly + autobeamer + properties: beamAutoEndx ??? rational string "1/2" + beamAutoBegin + beamAutoEnd + beamAuto + ScriptPadding + Direction + chordNameStyle (banter) + chordInversionPreserve + createInitdefaultClef + dynamicStyle + singleStaffBracket + numberOfStaffLines + + + {Mark,BarNumber,Margin}{Direction,ScriptPadding} + + ) -COMMENT( This document contains Mudela fragments. You need at least +COMMENT( +This document contains Mudela fragments. You need at least Yodl-1.30.18 to convert this to tex or html. - -TODO - -in stead <-> instead ) htmlbodyopt(bgcolor)(white) @@ -47,7 +71,7 @@ latexlayoutcmds( whentexinfo(notableofcontents()) -article(Mudela 1.0.7 / LilyPond 1.1.8 Reference Manual) +article(Mudela 1.0.14 / LilyPond 1.1.27 Reference Manual) (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen) (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop()) @@ -225,16 +249,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 grouping mm relative -accepts header musicalpitch remove -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) +verb(absdynamic duration mark property skip +accepts font midi pt spandynamic +alternative grouping mm relative tempo +bar header musicalpitch remove time +cadenza in name repeat times +chordmodifier include notenames scm translator +chords key notes scmfile transpose +clef keysignature paper score type +cm lyrics partial script version +consists maininput penalty shape) The right hand side of an identifier assignment is parsed completely when the assignment is made. It therefore must have any context @@ -318,6 +342,10 @@ notename of code(word). If no notename is found, then code(word) is treated as a string. If you mistype a notename, the parser will most likely complain that you should be in code(\lyrics) mode to do lyrics. +dit(Chord mode) Chord mode is instroduced by the keyword code(\chords). +Very similar to Note mode. +COMMENT(I'm not sure how it differs) + dit(Lyric mode) Lyrics mode is introduced by the keyword code(\lyrics). This mode is has rules that make it easy to include punctuation and diacritical marks in words. A word in Lyrics mode @@ -437,42 +465,66 @@ mudela(fragment,verbatim,center)( a'4. b'4. ) -In addition, the duration can be followed by a multiplier which is -introduced with the asterisk code(*) and can be an integer or a -fraction. The multiplier changes the duration that LilyPond uses -internally for the note, but for notes it -does not change the symbol that is printed. +Extra long notes can be obtained using the code(\breve) and +code(longa) durations: mudela(fragment,verbatim,center)( -c'4*2 c'4*2 d'8*2/3 d'8*2/3 +c'\breve gis'\longa +) + +In order to get triplets and other tuplets, you must use the +code(\times) keyword which multiplies the duration by a fraction. The +syntax is code(\times) var(fraction) var(music). The length of all of +the specified music will be multiplied by the fraction and the +fraction's denominator will be printed over the notes. The most +common tuplet is the triplet in which 3 notes have the length of 2, so +the notes are 2/3 their written length: +mudela(fragment,verbatim,center)( b'4 \times 2/3 {c'4 c' c'} d'4 d'4 ) +If you try to use code(\times) as the first thing in your music, you +may encounter the warning ``No one to print a tuplet start bracket''. +This happens because the Tuplet-engraver is in Voice and no Voice has +been created yet. You must explicitly specify the Voice context in +this situation +mudela(fragment,verbatim,center)( +\type Voice { \times 2/3 {c'4 d' e'}} ) + +A shorthand for code(\times) is to write code(*)var(fraction) after a +duration. This shorthand will not label triplets correctly, but +it is convenient for long rests. For long rests with durations equal to an integer number of whole notes, LilyPond produces output that indicates the duration of the rest. If you use code(r) then one rest symbol will be printed and several measures left blank. If you use code(R) then all of the measure will be filled with whole rests. +mudela(fragment,verbatim,center)( +r1 r1*3 R1*3 +) If you set the code(Score.SkipBars) property, then only one measure will be printed; with code(R), a number indicating the length of the rest will be displayed. mudela(fragment,verbatim,center)( -r1*3 R1*3 \property Score.SkipBars=1 -r1*3 R1*3) - -Extra long notes can be obtained using the code(\breve) and -code(longa) durations: +r1 r1*3 R1*3 +) +Even though the code(\times) command is not explicit, it is still +necessary to specify a code(Voice) context if the music begins with +rests lengthened using code(*). +Otherwise, the following will result: mudela(fragment,verbatim,center)( -c'\breve gis'\longa +R1*3 c'1 d' ) - -subsect(Note Spanners: Beams, Tuplets, Slurs and Ties) +subsect(Note Spanners: Beams, Slurs and Ties) A beam is specified by surrounding the beamed notes with brackets code([) and code(]). mudela(fragment,verbatim,center)( -[a'8 a'] [a'16 a' a' a'] +[a'8 a'] [a'16 a' a' a'] +) +Some more elaborate constructions: +mudela(fragment,verbatim,center)( +[a'16 c'' ] +\times 2/3 { [e'8 f' g'] } ) - -[EXPLAIN TUPLETS HERE] Another type of spanner is the slur. Slurs connects chords and try to avoid crossing stems. A slur is started with code(CHAR(40)) and stopped with @@ -492,6 +544,22 @@ mudela(fragment,verbatim,center)( e' ~ e' ~ ) +It is possible to create beams and slurs that cross staffs by switching the +context: +mudela(fragment,verbatim,center)( +< +\type Staff=one \notes\relative c'{ + \stemup + [c8 c \translator Staff=two \stemup c c] + \translator Staff=one + d4( \translator Staff=two )a4 + } +\type Staff=two \notes{ \clef bass;} +> +) + + +COMMENT(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) subsect(Note Ornaments) @@ -515,17 +583,17 @@ mudela()( c''-\open c''-\flageolet c''-\reverseturn c''-\trill c''-\prall c''-\mordent c''-\prallprall c''-\prallmordent - c''-\upprall c''-\downprall c''-\thumb} + 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 thumb}> - \paper{linewidth = 5.875\in; - indent = 0.0; - } -} + mordent prallprall prallmordent uprall downprall thumb } + > + \paper{ linewidth = 5.875\in; + indent = 0.0; } + } ) COMMENT( The following are defined in script.ly but do not work: @@ -572,6 +640,9 @@ mudela(fragment,verbatim,center)( c'' \< \! c'' d'' \decr e'' \rced < f''1 {s4 \< \! s4 \> \! s2 } >) + +COMMENT(Broken!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) + 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 of 8 gives one line across the note stem. @@ -683,6 +754,101 @@ code(\transpose) first. Any code(\relative) keywords that are outside the code(\transpose) have no effect on notes that appear inside the code(\transpose). +sect(Chords) + +Chords can be entered either by name or by listing the notes in angle brackets. +Chords can be displayed either as notes or by name. To enter chords by name, +either place them inside the code(\chords) keyword, or use +code(\notes) and surround them with +code(@) characters. +Chord names have the form +var(tonic)[var(duration)][code(-)var(modifier)][code(^)var(subtractions)][code(/)var(inversion)] +The var(tonic) should be the tonic note of the chord, and the var(duration) is +the chord duration in the usual notation. There are two kinds of modifiers. +One type is chord additions, which are obtained by listing intervals separated +by dots. An interval is written by its number with an optional code(+) or +code(-) to indicate raising or lowering by half a step. A chord additions has +two effects: it adds the specified interval and all lower odd numbered +intervals to the chord, and it may lower or raise the specified interval. +Intervals can be separated by a dot (code(.)) if you need to list +several unmodified intervals. +Repeating a code(-) character will remove a half step from the preceeding +interval. +mudela(fragment,verbatim,center)( +\transpose c''{ +\chords{ + c1 c-3- c-7 c-8 c-9 + c-9-5+7+ c-3-5- c-4.6.8 +}}) +The second type of modifier that may appear after the code(-) is +a named modifier. +Named modifiers are listed in the file file(chord-modifiers.ly). The +available modifiers are code(m) and code(min) which lower +the 3rd half a step, code(aug) which raises the 5th, code(dim) which lowers +the 5th, code(maj) which adds a raised 7th, and code(sus) which replaces the +5th with a 4th. +mudela(fragment,verbatim,center)( +\transpose c''{ +\chords{ + c1-m c-min c-maj c-aug c-dim c-sus +}}) + +Chord subtractions are used to eliminate notes from a chord. The notes to be +subtracted are listed after a code(^) character, separated by dots. +mudela(fragment,verbatim,center)( +\transpose c''{ +\chords{ + c1^3 c-7^5.3 c-8^7 +}}) + +Chord inversions can be specified by appending code(/) and the name of a +single note to a chord. This has the effect of lowering the specified note by +an octave so it becomes the lowest note in the chord. If the +specified note is not in the chord then a warning will be printed. +mudela(fragment,verbatim,center)( +\transpose c'''{ + @c1@ @c/e@ @c/g@ @c-7/e@ +}) +Throughout these examples, chords have been shifted around the staff +using code(\transpose). The code(\relative) keyword has odd effects +when combined with named chords. + +For displaying printed chord names, use the code(ChordNames) context. +The chords may be entered either using the notation described above, +or directly using angle brackets. +mudela(fragment,verbatim)( +< + \type ChordNames { \chords{ a b c} \notes{ < d f g > < e g b > } } + \type Staff \notes{ a b c' d' e' } +> +) +Lilypond examines chords specified as lists of notes to determine a +name to give the chord. By default, LilyPond will not try to identify +chord inversions: +mudela(fragment,verbatim,center)( +< + \type ChordNames { + \notes{ < e' g' c'' > } } + \type Staff \notes{ c' } +>) +If you want inversions to be recognized, you must set the property +code(Score.chordInversion): +mudela(fragment,verbatim,center)( +< + \property Score.chordInversion = 1 + \type ChordNames { + \notes{ < e' g' c'' > } } + \type Staff \notes{ c' } +>) + +COMMENT( + Two other properties + chordInversionPreserve + and chordNameStyle = Banter + exist. What do these do? +) + + sect(Lyrics) Lyrics are entered like notes, with pitches replaced @@ -714,39 +880,29 @@ URG Why does this warrant an URG? ) +When one word is attached to many notes, you may +want a continuous line after the lyric to show this. To achieve +this effect, add a code(__) lyric after the lyric to be extended. +This will create +an extender, a line that extends over the entire duration of +the lyric. There must be a lyric after the code(__), so if you want +to extend the final lyric, you will have to end with a blank lyric. +mudela(verbatim,center)( +\score{ +< \notes \relative c''{ + a4()b()c()d c()d()b()a } + \type Lyrics \lyrics { + foo1 __ bar2. __ _ } +> }) + -COMMENT( - -sect(Chords and Voices) - -Here's a simple chord -mudela(fragment,verbatim,center)( - -) - -here are a few -mudela(fragment,verbatim,center)( -< - { c'()d'()c' } - { e'()f'()e' } - { g'()a'()g' } -> -) - -and similarly voices -mudela(fragment,verbatim)( -< - { \voiceone c'4 g' c' g' } - { \voicetwo c2 g2 } -> -) +COMMENT(Broken!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) -) sect(Time) LilyPond aligns all musical objects according to the amount of time -they occupy. All of these objects have a duration. When music is +they occupy. All musical objects have a duration. When music is written sequentially using braces the duration is the sum of the durations of the elements. When music is stacked into simultaneous music using angle @@ -843,6 +999,30 @@ verb( ) +sect(Repeats) + +In order to specify repeats, use the code(\repeat) keyword. By +default, repeats are printed with repeat symbols. +mudela(fragment,verbatim,center)( +c'1 +\repeat 2 { c'4 d' e' f' } +\repeat 2 { f' e' d' c' }) +In order to specify alternate endings, use the code(\alternative) +keyword. +mudela(fragment,verbatim,center)( +c'1 +\repeat 2 {c'4 d' e' f'} +\alternative { {d'2 d'} {f' f} }) +When the repeats involve partial measures, it will be necessary to use +code(\partial) keywords to indicate which measures are short. +mudela(fragment,verbatim)( +\type Staff { \relative c'{ + \repeat 2 { \partial 4; e | c2 d2 | e2 f2 | } + \alternative { { g4 g g } {\partial 2.; a a a a | b1 } } +}}) +Repeats can be unfolded by setting the unfoldRepeats + + sect(Keywords) Keywords sometimes appear alone, but usually they require arguments. @@ -907,7 +1087,7 @@ mudela(center)( mudela(center)( \score{ \notes{\cadenza 1; \clef alto; c'4_"\kern -10mm alto" - \clef scarlatti; c'4_"\kern -4mm scarlatti" + % \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" @@ -973,7 +1153,7 @@ dit(code(\lyrics) var(lyriclist)) Parse var(lyriclist) in lyrics mode. dit(code(\maininput)) Internal command. This command is used for creating init files like file(init.fly) that read the user file into the middle of another -file. Using it in a user file will lead to an infinite loop. +file. It is illegal to use this command in a user file. dit(code(\mark) var(unsigned)code(;) or code(\mark) var(string)code(;)) Allowed in music only. Prints a mark over or under (depending on the @@ -1007,8 +1187,6 @@ code(\musicalpitch) keyword. dit(code(\notes) var(music)) Enter note mode and process the specified music. -dit(code(\)code(output) var(string)code(;)) Generate a parse error. - dit(code(\paper) var(statmentlist)) Appears in a score block to indicate that the music should be printed or to set output parameters. Can also appear at the top level to set @@ -1163,6 +1341,12 @@ dit(code(Voice)) Corresponds to a voice on a staff. This context handles the conversion of noteheads, dynamic signs, stems, beams, super- and subscripts, slurs, ties and rests. +dit(code(ChordNamesVoice)) A voice with chord names. Handles printing +of a line of chord names. + +dit(code(ChordNames)) Typesets chord names. Can contain +code(ChordNamesVoice) contexts. + dit(code(Lyrics)) Typesets lyrics. It can contain code(LyricVoice) contexts. dit(code(Staff)) Handles clefs, bar lines, keys, @@ -1177,6 +1361,10 @@ contexts. It adds a brace on the left side grouping the staffs together. The bar lines of the contained staffs are connected vertically. It can contain code(Staff) contexts. +dit(code(PianoStaff)) Just like code(GrandStaff) but with +code(minVerticalAlign) set equal to code(maxVerticalAlign) so that +interstaff beaming and slurring can be used. + dit(code(StaffGroup)) Contains code(Staff) or code(RhythmicStaff) contexsts. Adds a bracket on the left side, grouping the staffs together. The bar lines of the contained staffs are connected vertically. @@ -1262,7 +1450,7 @@ 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 +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. @@ -1275,7 +1463,7 @@ horizontally if they collide with other notes. This is useful when typesetting many voices on one staff. The identifier code(\shift) is defined to enable this. -dit(code(dynamicdir)) Determines location of dynamic marks. Set to +dit(code(dynamicDir)) 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. @@ -1379,6 +1567,8 @@ mudela(fragment,center)( } ) +COMMENT(Broken!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) + ) @@ -1420,8 +1610,12 @@ beams with zero slope. The identifiers code(\beamslopeproportional), code(\beamslopedamped), and code(\beamslopezero) each set the corresponding value. +dit(code(chordInversion)) 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. + ) - + COMMENT( @@ -1429,10 +1623,6 @@ Mystery properties: bar-number-engraver.cc: "barScriptPadding" vertical space for numbers span-bar-engraver.cc: "singleStaffBracket" do single staffs get a bracket? -bar-column-engraver.cc: "barColumnPriority" -bar-number-engraver.cc: "barNumberBreakPriority" Control horizontal ordering -mark-engraver.cc: "markBreakPriority" of bars, clefs, keysig -staff-margin-engraver.cc:"marginBreakPriority" etc. Slated for revision ) sect(Pre-defined Identifiers) @@ -1556,6 +1746,8 @@ at the top level, these assignments must be terminated by a semicolon. subsect(Paper variables) +Warning: this section is outdated and inaccurate. + There are a large number of paper variables that are used to control details of the layout. Usually you will not want to change these variables; they are set by default to vaules that depend on the font @@ -1601,17 +1793,10 @@ whether beams go up or down. It is real valued. If set to 2.0 then majority selection is used. If set to 3.0, then mean selection is used based on the mean center distance. If set to 4.0 then median selection is used, based on the median center distance. -dit(code(beam_ideal_stem1)) -dit(code(beam_ideal_stem2)) -dit(code(beam_minimum_stem1)) -dit(code(beam_minimum_stem2)) -dit(code(beam_multiple_break)) -dit(code(beam_slope_damp_correct_factor)) -dit(code(beam_thickness)) Specify the thickness of beams. dit(code(castingalgorithm)) dit(code(forced_stem_shorten)) Stems that have been forced to go the unnatural direction are shortened by this amount. Equal to -code(\interline) by default. +dit(code(forced_stem_shorten0)) dit(code(gourlay_energybound)) dit(code(gourlay_maxmeasures)) Maximum number of measures per line when using Gourlay method. @@ -1792,7 +1977,6 @@ The engravers for paper output are: description( dit(code(Abbreviation_beam_engraver)) -dit(code(Bar_column_engraver)) dit(code(Bar_engraver)) Engraves bar lines. Normally in code(Staff) and code(RhythmicStaff). dit(code(Bar_number_engraver)) Engrave bar numbers. These numbers @@ -1806,6 +1990,8 @@ with flags instead of beams. dit(code(Beam_req_swallow_translator)) Swallows beam requests. In code(LyricVoice). +dit(code(Chord_name_engraver)) Engraves chord names. Normally in +code(ChordNameVoice) dit(code(Clef_engraver)) Engraves the clef symbol. Normally in code(Staff). dit(code(Collision_engraver)) dit(code(Dot_column_engraver)) Engraves dots on dotted notes shifted to the @@ -1822,11 +2008,6 @@ 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 accidentals stay the same. -dit(code(Plet_engraver)) Engraves brackets and the number over tuplets. In -code(Voice). -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). diff --git a/Documentation/tex/tutorial.yo b/Documentation/tex/tutorial.yo index 69545dfc7b..b8c65bdf4f 100644 --- a/Documentation/tex/tutorial.yo +++ b/Documentation/tex/tutorial.yo @@ -524,8 +524,8 @@ that is covered in bind(Section)ref(sec:polyphonic). subsect(Chords with names) -In the previous section we have been talking more about 'stacked notes' -rather than 'chords'. +In the previous section we have been talking more about `stacked notes' +rather than `chords'. If you need to enter a lot of chords that have proper names, you can use the code(\chords) mode as an alternative: COMMENT( diff --git a/NEWS b/NEWS index 33f8cece3e..025a588956 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,16 @@ -pl 27.jcn4 - - measure-end hinterfleish patch - - input/test/coda-kludge.ly - - bf: volta-number placement - - volta: support for "1.-2." "3" +pl 28 +pl 27.hwn2 + - un-SMOB Atom. Cons and Killing_cons as simple cons replacements. + +pl 27.jcn5 + - outline TODO +pl 27.jcn4 + - measure-end hinterfleish patch + - input/test/coda-kludge.ly + - bf: volta-number placement + - volta: support for "1.-2." "3" + pl 27.jcn3 - bf's: zero-length repeats - Auto beamer: @@ -17,13 +24,39 @@ pl 27.jcn3 * bf's: banter_str - new bool \property Score.barAtLineStart +pl 27.hwn1 + - global ctors + - read lily.scm before all .lys + - Link_array derives from Array + - search repl: Array -> Link_array + - junked most static casts + - revamped Atom / Molecule: Molecule now is the public interface. +Atom is a GUILE smob. Guile takes care of allocation and list stuff. + - bar scripts on score bars (there you are, Mats) + - :||: span bar fixed + - using generic ledger lines now (regenerate fonts!) + - refman updates (Thanks, Adrian!) + - Molecule::operator = (), Molecule::do_center () + - junked Span_score_bar, Score_bar, Staff_bracket, Piano_brace. Folded functionality into Span_bar + - textstyle property for textual scripts. + - lookup cleanups (time_signature, text, stem, junked extender, filledbox, simple_bar) + - junked obsolete TeX stuff. + - ly2dvi-testpage.ly + - only make AFMs for feta[0-9]+.mf + - using strings for abs loudness. + + pl 27.jcn2 - - grand renaming: Duration vs Moment / Rational + - grand renaming: Duration vs Moment / Rational + +pl 27.uu1 + - extra beam warning pl 27.jcn1 - complete redo of chord and chord name code - small fixes +************* pl 27 (feb 3) pl 26.uu1 diff --git a/TODO b/TODO index 18ca8899f6..cbad789b41 100644 --- a/TODO +++ b/TODO @@ -1,108 +1,66 @@ -Features you cannot find in the doco as working, should be mentioned -here. - -This is an assorted collection of stuff that will be done, might be -done, or is an idea that I want to think about +# -*-outline-*- +* GNU LilyPond TODO +Features you cannot find in the doco as working, should be +mentioned here. This is an assorted collection of stuff that will be +done, might be done, or is an idea that I want to think about Most of the items are marked in the code as well, with full explanation. grep for TODO and ugh/ugr/urg -*In a piece such as the Zipoli piece in mutopia/... there is a stray -`8' over every bar line when processed by LilyPond 1.1.25. - -TODO before 1.2 - - - cf'able ly2dvi tagline. - - - make ly2dvi test page. - - - fix dynamics decently, ie. use kerning & ligatures. Junk -TeX macros. - - - - span bars. ->gallina - -******* -m=\notes\relative c'{ -\voiceone -c1 -\mark "A"; R1*3 \mark "B"; -<{R1*3}{s1 \mark "C";}> -} - -n=\notes\relative c'{ -\voicetwo -c1 | c1 | c1 | c1 | c1 | c1 | c1 | -} - -\score{ - \type StaffGroup < - \type Staff = m <\m> - \type Staff = n <\n> - > - - \paper { - \translator { \OrchestralScoreContext - markScriptPadding = "4.0"; - } - } -} -********* - - * junk Text_def, use G_text_item in stead. - - * junk Script_def - - * fix partial measures in meaningful way. - - * fix AFM for BlueSky AFM files. - - * working notehead style. - - * add scripts to bars eg. |^"bla" - - * relative mode for mi2mu - - * uniformise recent feta contributions. - - use SCM and Molecules for {accordeon stuff, } - - bigger and fatter 4/4 C - - * make a SMOB of Atom and Molecule - - * sort out directory stuff. - - --prefix option? - - -I option per filetype? - - kpathsea? - - * is \break broken? input/test/hara-kiri.ly - - * fix OrchestralScore and Hara-kiri (i.e., fix Coriolan) - -************** -I also found a few bugs: - -* The examples in input/test/bar-scripts.ly and score-bar-scripts.ly - don't work. The problem seems to be that you can't define a - a score identifier and then use it in the \score block. - - - - make separate MF chars for endings of ledger lines, and calc rest of lines. - - * support_l_arr_ empty in staff-margin's G_staff_side_item - - * todo doc left/rightbeamcount - - - * doc Single_malt_grouping_item - - * ly2dvi/lilypond logfile. - - * remove old preformats in RPM - -************ - -How can I specify a chord whose duration is longer than a whole note? - +** BUGS +*** .ly files +**** input/praeludium-fuga-E.ly +**** mutopia/J.S.Bach/wtk1-fugue2.ly +**** fix: text on rests: rediculous dims +*** fix midi output: +**** default duration? d + duration must be not entered explicitely on first note. +*** fix singleStaffBracket +*** \shape 1st dim skipped? +*** turn slope-damping on/off +*** c4 \! \> c4 +*** tremolo stuff +*** gallina barlines. +*** fix height of / collisions with lyrics (chords), + see input/test/vertical-text.ly; input/test/repeat.ly +*** latex bla.tex broken (titles / \lilyfooter stuff?) +*** fix dynamics decently, ie. use kerning & ligatures. +*** fix "I've been drinking too much" +*** support_l_arr_ empty in staff-margin's G_staff_side_item +*** remove old preformats in RPM +*** declaring \score +*** is \break broken? input/test/hara-kiri.ly +*** fix OrchestralScore and Hara-kiri (i.e., fix Coriolan) + +** TODO before 1.2 +*** do scaled fonts. +*** profile atom smobs +*** make ly2dvi test page. +*** Try to use Killing_cons iso. Pointer_list +*** make dependencies () a virtual function. +*** fix Repeated_music_iterator::ok() (constness.) +*** one big ly2dvi input that includes *all* tests. +*** Don't use boolean properties (0,1), instead check existence +of property. +*** store req -> element, element -> element causes for warnings +*** junk Text_def, use G_text_item in stead. +*** junk Script_def +*** fix partial measures in meaningful way. +*** fix AFM for BlueSky AFM files. +*** working notehead style. +*** add scripts to bars eg. |^"bla" +*** relative mode for mi2mu +*** uniformise recent feta contributions. +**** use SCM and Molecules for {accordeon stuff, } +**** bigger and fatter 4/4 C +*** sort out directory stuff. +**** --prefix option? +**** -I option per filetype? +**** kpathsea? +*** todo doc left/rightbeamcount +*** doc Single_malt_grouping_item +*** ly2dvi/lilypond logfile. +*** How can I specify a chord whose duration is longer than a whole note? \type ChordNames { \chord{ A1*2-min } } gives me a parse error. And \times doesn't work either. I can't use @@ -177,117 +135,48 @@ I was trying to get interstaff beams to work and did this: } The beams are at the right angle, but they aren't in the right place. - - - -******************* - - - * fractional chord durs. - - * hang Item on Spanner - - * remove Interval dim_ from Dimension_cache and rename the struct. - - * do --safe for PS output? - - * convert-mudela --output - - * Staff_margin (with a partial measure.) - - * fix "I've been drinking too much" - - * fix pletvisibility properties: - - bracket on/off/no-bracket-when-beam - - num on/off/no-num-when-beam - - * fix: standchen. - - * junk backlinks? - - * junk text{sharp,flat,etc} - - * fix convert-mudela manpage - - * decimal point in \paper {} - - *{ \voiceone [g''8 fis'' e''] d''4 |} +*** fractional chord durs. +*** hang Item on Spanner +*** remove Interval dim_ from Dimension_cache and rename the struct. +*** do --safe for PS output? +*** convert-mudela --output +*** Staff_margin (with a partial measure.) +*** fix "I've been drinking too much" +*** fix pletvisibility properties: +**** bracket on/off/no-bracket-when-beam +**** num on/off/no-num-when-beam +*** fix: standchen. +*** junk backlinks? +*** junk text{sharp,flat,etc} +*** fix convert-mudela manpage +*** decimal point in \paper {} +*** { \voiceone [g''8 fis'' e''] d''4 |} and=20 { \voicetwo d'4 d'2.*2/3 } spacing - - * tied notes for MIDI - - * sharp /flat on trills (in MIDI ??) - - * scm-ify \property values. - - * move class Lookup {} into scm - -BUGS: - - * collisions/voices \voiceone \voicetwo are broken; see - input/praeludium-fuga-E.ly - mutopia/J.S.Bach/wtk1-fugue2.ly - - * fix: text on rests: rediculous dims - - * ly2dvi - - bottomnote for ly2dvi - - deps for ly2dvi - - * fix midi output: - - default duration? duration must be not entered - explicitely on first note. - - * turn slope-damping on/off - - * c4 \! \> c4 - - * tremolo stuff - - * gallina barlines. - - * fix height of / collisions with lyrics (chords), - see input/test/vertical-text.ly; input/test/repeat.ly - - * latex bla.tex broken (titles / \lilyfooter stuff?) - - * msgfmt -o check? - - * \breathmark TeX macro - - * catch GUILE errors? - - * add new glyphs to font.ly - - * formatting of input stuff. - - * \notes{ a \< b \cr } vs \notes{ a \< b \! } - - * if possible, it might be nice for a warning to appear if someone does +*** tied notes for MIDI +*** sharp /flat on trills (in MIDI ??) +*** scm-ify \property values. +*** move class Lookup {} into scm +*** collisions/voices \voiceone \voicetwo are broken; see +*** msgfmt -o check? +*** \breathmark TeX macro +*** catch GUILE errors? +*** add new glyphs to font.ly +*** formatting of input stuff. +*** \notes{ a \< b \cr } vs \notes{ a \< b \! } +*** if possible, it might be nice for a warning to appear if someone does \translator with no name and without assigning it to an identifier. - - * space after bars? - - * 'hinterfleisch' before bar (e.g. wtk1-fugue2)? - - * \type Voice \times 2/3 { [c8 c16 c16 c16 c16] } - - * fix singleStaffBracket - - * repeat bars: need distance after ":|" and before "|:" - - Summary of minor spelling irregularities: - - capitalization/use of underscores in property names - - * fix SkipBars -> skipBars - - * \shape 1st dim skipped? - - * fix marks/barnumbers/marginal notes - - * broken scripts: +*** space after bars? +*** 'hinterfleisch' before bar (e.g. wtk1-fugue2)? +*** \type Voice \times 2/3 { [c8 c16 c16 c16 c16] } +*** repeat bars: need distance after ":|" and before "|:" +** Summary of minor spelling irregularities: +*** capitalization/use of underscores in property names +*** fix SkipBars -> skipBars + +*** fix marks/barnumbers/marginal notes +*** broken scripts: lbheel = \script { "bheel" 0 0 -1 0 0 } rbheel = \script { "bheel" 0 0 1 0 0 } lbtoe = \script { "btoe" 0 0 -1 0 0 } @@ -300,404 +189,296 @@ BUGS: and also portato= \script { "portato" 0 -1 0 1 0 } - -STUFF - * check out legal/(c) matters for scores. - - * check out GCC signatures? - - * Align_element::padding ? - - * uniformise property names... - - ydirection <-> yDirection - - rather allow '_' in identifiers first (i.e. junk ^ and _), +*** ly2dvi +**** bottomnote for ly2dvi +**** cf'able ly2dvi tagline. +**** deps for ly2dvi +** STUFF +*** check out legal/(c) matters for scores. +*** check out GCC signatures? +*** Align_element::padding ? +*** uniformise property names... +**** ydirection <-> yDirection +**** rather allow '_' in identifiers first (i.e. junk ^ and _), and do y_direction? - - typo checks on property names? - - * use streambufs and iostream +**** typo checks on property names? +*** use streambufs and iostream to provide IO handling for TeX stream, mudela stream, data-file. - - * seriously buffer TeX output (do profile of writing .5 mb TeX file.) - - * strip EXEs before installing - - * zip target for binary windows dist (JBR) - - * junking \skip req in lyrics - - * Language: - - \type -> \context ? - - \translator -> ? - - fix \partial - - \bla {} vs \bla ; - - mix engraver hacking with music ? - - \once\property KEY = VAL - - \addtranslator, \removetranslator - - junk ^ and _ for scripts - - junk _ for lyrics. - - abstract grammar. - - * percussion note heads - - * mi2mu empty staffs. - - * horizontal centering of dynamics - - * \font\fontA=feta20.afm (.afm?) - - * gzip RH manpage - - * stable make/config stuff - - * $DEPENDENCIES_OUTPUT support - - * Xdvi zooming ?! Try to understand GS garbage collection. +*** seriously buffer TeX output (do profile of writing .5 mb TeX file.) +*** strip EXEs before installing +*** zip target for binary windows dist (JBR) +*** junking \skip req in lyrics +*** Language: +**** \type -> \context ? +**** \translator -> ? +**** fix \partial +**** \bla {} vs \bla ; +**** mix engraver hacking with music ? +**** \once\property KEY = VAL +**** \addtranslator, \removetranslator +**** junk ^ and _ for scripts +**** junk _ for lyrics. +**** abstract grammar. +*** percussion note heads +*** mi2mu empty staffs. +*** horizontal centering of dynamics +*** gzip RH manpage +*** stable make/config stuff +*** $DEPENDENCIES_OUTPUT support +*** Xdvi zooming ?! Try to understand GS garbage collection. gs: Error: /undefined in draw_beam gs: Operand stack: - - * fix vertical alignment and stafflines - - * GrandStaff needs more work -- I want a single word +*** fix vertical alignment and stafflines +*** GrandStaff needs more work -- I want a single word `harpsichord' to the left of the grandstaff, not one on each stave. (Organ staff -- with separate pedal -- but common properties may be something to think about. Of course for organ you want to be able to give stop indications on the way through, so the \property Voice.Instrument would be a stop, and \property GrandStaff.instrument would be PipeOrgan...) - - * revise the Score_priority_align_engraver concept. It sucks. - - * make new VoiceOne, VoiceTwo, VoiceThree contexts with +*** revise the Score_priority_align_engraver concept. It sucks. +*** make new VoiceOne, VoiceTwo, VoiceThree contexts with ydirection and hshift preset - - * *.yo: fix pod manpage layout legacy - - * text-items clash with stems/beams - - * --include, -I option for ly2dvi (pass on to lily) - - * fix placement of beam-less abbrev - - * \meter 3/4; +*** *.yo: fix pod manpage layout legacy +*** text-items clash with stems/beams +*** --include, -I option for ly2dvi (pass on to lily) +*** fix placement of beam-less abbrev +*** \meter 3/4; <{\voiceone cis4. cis8 cis4 | cis4 cis cis | r1 } {\voicetwo cis,4 r r | r2. | r1 }> | } - - * try to use template iso MACRO(Type) - - - NEWS: ... Musical_pitch (analogous to Duration and Rhythmic_req) +*** try to use template iso MACRO(Type) +**** NEWS: ... Musical_pitch (analogous to Duration and Rhythmic_req) think about, analogous to pitch: * { a4 a16 } c <-- duration of c? * < a4 b8 > c <-- duration of c? - - * \tempo 4. = 90; - - * fix audio-items (don't use (input) requests, but copy data) - - * make sure all ex's have a mudela-version - - * do rest-collisions for Multi_measure_rests as well. - - * split error/warning in error/warning/non_fatal_error - - * add a Duration_convert member to Duration_iter to set parameters. +*** \tempo 4. = 90; +*** fix audio-items (don't use (input) requests, but copy data) +*** make sure all ex's have a mudela-version +*** do rest-collisions for Multi_measure_rests as well. +*** split error/warning in error/warning/non_fatal_error +*** add a Duration_convert member to Duration_iter to set parameters. Junk global duration settings. - - * minimum length second part broken tie - - * en-,discouraged linebreaking: - - handle DISALLOW < penalty > FORCE - - discourage breaking of slurs - - * fix variable define/lookup parser global<->paper - - * fix title/instrument placements; see input/test/title.ly - - * <\voiceone c4. \voicetwo c4> - - * add full cello suites to web site (kom op, Maarten!) - - * Rethink Time_description +*** minimum length second part broken tie +*** en-,discouraged linebreaking: +**** handle DISALLOW < penalty > FORCE +**** discourage breaking of slurs +*** fix variable define/lookup parser global<->paper +*** fix title/instrument placements; see input/test/title.ly +*** <\voiceone c4. \voicetwo c4> +*** add full cello suites to web site (kom op, Maarten!) +*** Rethink Time_description * \cadenza , \meter, \grouping should all be \properties - - * rename - - measure -> bar - - abbrev -> tremolo - - abbreviation-beam -> (measured/unmeasured) tremolo - - partial -> anacrouse - - * shared lib - - * robustify Beam (in case of no stems, 32nd notes) - - * decentralised spring factory - - * move paper vars into engraver properties - - * check for groff / troff/ nroff et - - * more intelligent file searching - - * make LilyPond RPM fully relocatable - - * disable spaces in TeX stuff - - * handle ^C for tmp/file creation. - - * dots & rest collisions. - - * documentation - - introduction? - - info? - - LaTeX? - - more manpages? - - * versioning for Feta - - * the warning about the negative slur/tie length appears twice +*** rename +**** measure -> bar +**** abbrev -> tremolo +**** abbreviation-beam -> (measured/unmeasured) tremolo +**** partial -> anacrouse +*** shared lib +*** robustify Beam (in case of no stems, 32nd notes) +*** decentralised spring factory +*** move paper vars into engraver properties +*** check for groff / troff/ nroff et +*** more intelligent file searching +*** make LilyPond RPM fully relocatable +*** disable spaces in TeX stuff +*** handle ^C for tmp/file creation. +*** dots & rest collisions. +*** documentation +**** introduction? +**** info? +**** LaTeX? +**** more manpages? +*** versioning for Feta +*** the warning about the negative slur/tie length appears twice which is irritating. - - * The `3' in the meter key is a one or two pixels too thin (at 600dpi) +*** The `3' in the meter key is a one or two pixels too thin (at 600dpi) in the middle: - - * the bracket is ugly (wings are too parabolic, should be more circular) - - * better hshift (dots, distance, head dependent) - +*** the bracket is ugly (wings are too parabolic, should be more circular) +*** better hshift (dots, distance, head dependent) * clefs (AG): The "8" should appear closer to the actual clef, touching it. - - * put errorlevel in Input class - - * junk nesting slurs - - * integrate midi-elts from mi2mu and lily? - - -3RD PARTY BUGS: -**************** -/* -ICE -*/ -signature S { - int foo (); -}; - -signature V { - S * s(); -}; - - -V*v(); -f () -{ - return v( )->foo (); -} - -/* - - egcs-1.1 - -foo.cc: In function `int f()': -foo.cc:6: label `b' used but not defined -*/ -void -f () -{ - bool b; - if (b && && b) - ; -} -*************** - - * make GCC warn about ctor that leaves member vars uninitialised. - - * GNU diff 2.7: diff -rN does not see a new directory with empty file - - * glibc 2.0: - +*** put errorlevel in Input class +*** junk nesting slurs +*** integrate midi-elts from mi2mu and lily? +** 3RD PARTY BUGS +*** GNU diff 2.7: diff -rN does not see a new directory with empty file +*** glibc 2.0: f = fopen ("/dev/null", "r") assert (feof (f)) - -3RD PARTY PROJECTS: - - * GNU patch - - 'double-fix' mode: ignore identical fix, rather than suggest +** 3RD PARTY PROJECTS: +*** make GCC warn about ctor that leaves member vars uninitialised. +*** GNU patch +**** 'double-fix' mode: ignore identical fix, rather than suggest to revert patch direction when (more or less? exactly) the same thing is fixed - -PROJECTS - - * Scripts: - - fix position of bar number - - stack scripts in chords: +** PROJECTS +*** Scripts: +**** fix position of bar number +**** stack scripts in chords: % fingering: footing: < a-4 c-2 g-1 > < c-\ltoe e-\lheel > - - script-spacing - - slur parts as a script - - stack parameterised scripts for fingering and footing: - - * convert-mudela: - - automatically add a \version if not present. - - better parsing - - make smarter - - convert-mudela -e empty.ly - - * emacs mudela-mode - - should handle block comments too. - - handle lexer modes (\header, \melodic, \lyric) etc. - - indentation - - notenames? - - fontlock: \melodic \melodic - - * use properties for: - - plet? - - Staff_sym size - - default tempo. - - font size - - bartypes (get rid of derived Span_bar_engravers) - - cadenza mode? - - * page handling: - - PS output - - optimal pagebreaking. - - * Unicode support? -> man 7 unicode - - 16 bit Strings - - -u switch - - detect of 16/8 bit files - - examples to go with it. - - * Spring_spacer: - - write a faster Spring_spacer (without matrices if possible) - - relate energybound to linelen unitspace fontsize etc. - - used fixed point fp? - - * \header - - output header info to MIDI too. - - * a musical dictionary. See Documentation/vocabulary-*, other +**** script-spacing +**** slur parts as a script +**** stack parameterised scripts for fingering and footing: + +*** convert-mudela: +**** automatically add a \version if not present. +**** better parsing +**** make smarter +**** convert-mudela -e empty.ly + +*** emacs mudela-mode +**** should handle block comments too. +**** handle lexer modes (\header, \melodic, \lyric) etc. +**** indentation +**** notenames? +**** fontlock: \melodic \melodic + +*** use properties for: +**** plet? +**** Staff_sym size +**** default tempo. +**** font size +**** bartypes (get rid of derived Span_bar_engravers) +**** cadenza mode? + +*** page handling: +**** PS output +**** optimal pagebreaking. + +*** Unicode support? -> man 7 unicode +**** 16 bit Strings +**** -u switch +**** detect of 16/8 bit files +**** examples to go with it. + +*** Spring_spacer: +**** write a faster Spring_spacer (without matrices if possible) +**** relate energybound to linelen unitspace fontsize etc. +**** used fixed point fp? + +*** \header +**** output header info to MIDI too. + +*** a musical dictionary. See Documentation/vocabulary-*, other languages: - - explanations - - italian - - german - - dutch - - swedish +**** explanations +**** italian +**** german +**** dutch +**** swedish .. ? - * chords - - guitar chords (fret diagrams) - - other chord name styles (american(?) style) - - basso continuo - - MIDI output? - - * Debug logs: - - derive lily_stream, Dstream, texstream from ostream? - - indentable stream as baseclass for TeX stream, lily stream, Dstream. - - use dstream feature in mi2mu - - integrate IO checking into stream class - - * input converters - - NIFF? - - ABC? - - SMDL? - - * add to MIDI output: - - tempo change - - ornaments (and trills?) - - repeat/volta - - slurs - - accents - - dynamics - - account for rhythmic position in measure - - etc. - - * grace notes - - make separate class for Grace_*_engravers +*** chords +**** guitar chords (fret diagrams) +**** other chord name styles (american(?) style) +**** basso continuo +**** MIDI output? + +*** Debug logs: +**** derive lily_stream, Dstream, texstream from ostream? +**** indentable stream as baseclass for TeX stream, lily stream, Dstream. +**** use dstream feature in mi2mu +**** integrate IO checking into stream class + +*** input converters +**** NIFF? +**** ABC? +**** SMDL? + +*** add to MIDI output: +**** tempo change +**** ornaments (and trills?) +**** repeat/volta +**** slurs +**** accents +**** dynamics +**** account for rhythmic position in measure +**** etc. + +*** grace notes +**** make separate class for Grace_*_engravers (which is at Voice_gravs level) - - make encapsulated spacing problems. +**** make encapsulated spacing problems. - * accidentals per Voice_group +*** accidentals per Voice_group - * Output class, handles : (smallish) - - help text /(c) notice? - - version line - - warning /errors/progress - - abort on error/warning; exit status - - quiet/ignore-version options - - logfile output +*** Output class, handles : (smallish) +**** help text /(c) notice? +**** version line +**** warning /errors/progress +**** abort on error/warning; exit status +**** quiet/ignore-version options +**** logfile output - * elaborate Staff_side baseclass: - - scripts - - text - - slur start/end +*** elaborate Staff_side baseclass: +**** scripts +**** text +**** slur start/end - * PS - - speed up PS code. - - PS lines to .eps files - - write custom prolog +*** PS +**** speed up PS code. +**** PS lines to .eps files +**** write custom prolog - * Output an output format independent (ofi) typeset file; and +*** Output an output format independent (ofi) typeset file; and make ofi2 TeX, MusiXTex, Display PostScript, PostScript, Ascii... interpreters. (difficult) - - NIFF ? - - Common Music Notation - - PostScript output (esp. Beams, Slurs, etc) - - Move all Score_elems, into libmutype.a - - SGML - - * Documentation - - Doc (C) stuff of sheet music - - a better format? SGML? TeX? Info? - - a better tutorial - - * more spanners (smallish) - - Glissando - - trill - - * Rewrite Stem, Beam and Rhythmic_grouping (hairy) - - [c8. c32 c32] - - doc on Rhythmic_grouping - - general shaving on Beam and Stem - - use plet grouping - - separate visual from rhythmic info even more - - beams over bars - - * lines: - - Ledger lines, should be separate item: Ledger_lines, Ledger_lines - - set different line sizes / thicknesses - - beam stem showthrough, inter beam sizes (french vs german style) - - * Collisions - - left/right note balls should be handled by Collision: +**** NIFF ? +**** Common Music Notation +**** PostScript output (esp. Beams, Slurs, etc) +**** Move all Score_elems, into libmutype.a +**** SGML + +*** Documentation +**** Doc (C) stuff of sheet music +**** a better format? SGML? TeX? Info? +**** a better tutorial + +*** more spanners (smallish) +**** Glissando +**** trill + +*** Rewrite Stem, Beam and Rhythmic_grouping (hairy) +**** [c8. c32 c32] + **** doc on Rhythmic_grouping +**** general shaving on Beam and Stem +**** use plet grouping +**** separate visual from rhythmic info even more +**** beams over bars + +*** lines: +**** Ledger lines, should be separate item: Ledger_lines, Ledger_lines +**** set different line sizes / thicknesses +**** beam stem showthrough, inter beam sizes (french vs german style) + +*** Collisions +**** left/right note balls should be handled by Collision: < \multi 2; { \stem 1; } { } > - * Keys: - - merge key{item} & localkey{item}? - - spacing, national styles? +*** Keys: +**** merge key{item} & localkey{item}? +**** spacing, national styles? - * Support for TAB - - redo Notehead to allow digits as heads - - add a \tablature {} lexer mode for easy entering +*** Support for TAB +**** redo Notehead to allow digits as heads +**** add a \tablature {} lexer mode for easy entering - * should adjust stemlength for flag number. +*** should adjust stemlength for flag number. - * breaking: - - caching breakpoints - - saving them - - specify number of lines +*** breaking: +**** caching breakpoints +**** saving them +**** specify number of lines +** INPUTLANGUAGE -INPUTLANGUAGE - - * c4 4 4 4 for c4 c4 c4 c4? - - * neatly (and readably) expressing concurrent +*** c4 4 4 4 for c4 c4 c4 c4? +*** neatly (and readably) expressing concurrent voices - - * 4 ? - - * Viola mode? +*** 4 ? +*** Viola mode? @c c g e g for @@ -706,49 +487,46 @@ INPUTLANGUAGE @A c g e g for cis gis e gis +*** relative mode for pitch entering +*** configure pitch_byte +*** rest name configurable - * relative mode for pitch entering - - * configure pitch_byte - - * rest name configurable -SMALLISH PROJECTS +** SMALLISH PROJECTS - * limit memory usage; the full coriolan takes up too much resources. +*** limit memory usage; the full coriolan takes up too much resources. - * fix confusing naming in Engraver vs Engraver_group_engraver (context) +*** fix confusing naming in Engraver vs Engraver_group_engraver (context) - * progress when creating MIDI elts. +*** progress when creating MIDI elts. - * A range for context errors (eg. mark both { and }. ) +*** A range for context errors (eg. mark both { and }. ) - * lyric in staff (sharpsharp in staff, text below) +*** lyric in staff (sharpsharp in staff, text below) - * half sharps/flats +*** half sharps/flats - * write Dynamic_line (to group dynamics horizontally) +*** write Dynamic_line (to group dynamics horizontally) - * use Real for all y positions. - - use translate_axis( .. ,Y_AXIS) iso separate variables. +*** use Real for all y positions. - * half-sharps, half-flats +*** half-sharps, half-flats - * adaptive accidental spacing. +*** adaptive accidental spacing. - * handle EOF graciously in error messages. +*** handle EOF graciously in error messages. - * declare notenametab? +*** declare notenametab? - * midi esp.: use I32 iso int where 32 bits are needed (or assumed...) +*** midi esp.: use I32 iso int where 32 bits are needed (or assumed...) - * stafftypes: voice names/ instrument names. +*** stafftypes: voice names/ instrument names. - * lily \tempo +*** lily \tempo - * C meter iso 4/4, idem for alla breve, etc. +*** C meter iso 4/4, idem for alla breve, etc. - * textspanner: center position +*** textspanner: center position * % toe to bheel four to five % ^_u 4_5 @@ -758,43 +536,28 @@ SMALLISH PROJECTS % --|--- --|--- (where "to" is a tiny bow) - * auxilliary file for caching info. - - * Text_crescendo - - * clean solution for staffsize in items. - - * revise calcideal - -IDEAS - - * Output data structures of Mudela in XML/SGML. - - * create libmudela, or liblily_frontend - - * move MIDI stuff (including Quantization) to a ANSI C libmidi library. - - * Spacing_request for manually adjusting spacing - - * caching breakpoints - - * used fixedpoint arithmetic for min. energy. - - * move towards incremental algorithms. - - * far fetched language ideas - - design meta-language like TeX and Metafont - - programming/macros input - - * versioning stuff (cvt mudela, mudela, etc.) - - * Klavarskribo? - - * dynamic loading of engravers? - -SMOBS: - -**************************************** +*** auxilliary file for caching info. + +*** Text_crescendo + +*** clean solution for staffsize in items. + +*** revise calcideal +** IDEAS +*** Output data structures of Mudela in XML/SGML. +*** create libmudela, or liblily_frontend +*** move MIDI stuff (including Quantization) to a ANSI C libmidi library. +*** Spacing_request for manually adjusting spacing +*** caching breakpoints +*** used fixedpoint arithmetic for min. energy. +*** move towards incremental algorithms. +*** far fetched language ideas +**** design meta-language like TeX and Metafont +**** programming/macros input +*** versioning stuff (cvt mudela, mudela, etc.) +*** Klavarskribo? +*** dynamic loading of engravers? +** SMOBS Han-Wen Nienhuys writes: > mcmanus@IDT.NET writes: @@ -910,8 +673,6 @@ I hope the above helps, if you just sit there." --Will Rogers (1879-1935) -*************************** - > I am still muddling along with integrating GUILE in LilyPond, and I > have a question. I want to replace an existing C++ implementation of > identifier tables by GUILE's code. I've managed to replace @@ -955,4 +716,6 @@ tranlate it to C by hand. "Whenever you find yourself on the side of the majority, it is time to pause and reflect." -- Mark Twain -*********************** + + + diff --git a/VERSION b/VERSION index 0c0b456e0d..e7993396d2 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=27 -MY_PATCH_LEVEL=jcn4 +PATCH_LEVEL=28 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/configure b/configure index 7ea69f0553..450066ecde 100755 --- a/configure +++ b/configure @@ -2862,11 +2862,9 @@ fi fi -CXXFLAGS="$CXXFLAGS -fhandle-signatures" - echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2870: checking for 8-bit clean memcmp" >&5 +echo "configure:2868: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2874,7 +2872,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2905,12 +2903,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2909: checking for vprintf" >&5 +echo "configure:2907: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2960,12 +2958,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2964: checking for _doprnt" >&5 +echo "configure:2962: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -3018,12 +3016,12 @@ fi for ac_func in memmem snprintf vsnprintf gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3022: checking for $ac_func" >&5 +echo "configure:3020: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3088,7 +3086,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3092: checking for $ac_word" >&5 +echo "configure:3090: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/configure.in b/configure.in index 4f251a61fe..854c957dd4 100644 --- a/configure.in +++ b/configure.in @@ -39,8 +39,6 @@ AC_STEPMAKE_TEXMF AC_STEPMAKE_YODL AC_STEPMAKE_GUILE -CXXFLAGS="$CXXFLAGS -fhandle-signatures" - dnl should check out -print dnl huh? dnl AC_CHECK_SEARCH_RESULT($FIND, find, Please use --enable-tex-dir) diff --git a/flower/include/array.hh b/flower/include/array.hh index cc489fdf10..c8fe30f16f 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -56,15 +56,12 @@ protected: public: /// check invariants - void OK() const - { - assert (max_ >= size_ && size_ >=0); - if (max_) assert (array_p_); - } + void OK() const ; /** report the size_. @see {setsize_} */ + int size() const { return size_; @@ -88,10 +85,10 @@ public: // ugh, get around gcc 2.8.1 ice; see bezier.cc Array (int i) - { - max_ = size_ = i; - array_p_ = new T[i]; - } + { + max_ = size_ = i; + array_p_ = new T[i]; + } /** set the size_ to #s#. @@ -107,17 +104,13 @@ public: { delete[] array_p_; } /// return a "new"ed copy of array - T* copy_array() const + T* copy_array() const { T* Tarray = new T[size_]; arrcpy (Tarray, array_p_, size_); return Tarray; } - // depracated - operator T*() const - { - return copy_array(); - } + void operator=(Array const & src) { set_size (src.size_); @@ -130,37 +123,36 @@ public: } /// tighten array size_. - void precompute() { - remax (size_); - } - - T * remove_array_p () { - T * p = array_p_; - size_ = 0; - max_ = 0; - array_p_ =0; - return p; + void precompute() { + remax (size_); } + + T * remove_array_p (); /// access element T &operator[] (int i) { - return elem (i); + return elem_ref (i); } /// access element - T const & operator[] (int i) const + T const & operator[] (int i) const { - return elem (i); + return elem_ref (i); } /// access element - T &elem (int i) const + T &elem_ref (int i) const { assert (i >=0&&i slice (int lower, int upper) - { - assert (lower >= 0 && lower <=upper&& upper <= size_); - Array r; - int s =upper-lower; - r.set_size (s); - arrcpy (r.array_p_, array_p_ + lower, s); - return r; - } + Array slice (int lower, int upper) ; void reverse(); }; diff --git a/flower/include/array.icc b/flower/include/array.icc index 0077a01d08..807382880e 100644 --- a/flower/include/array.icc +++ b/flower/include/array.icc @@ -64,3 +64,34 @@ Array::reverse () swap (i,j); } +template INLINE +void +Array::OK() const +{ + assert (max_ >= size_ && size_ >=0); + if (max_) assert (array_p_); +} + +template INLINE +T * +Array::remove_array_p () +{ + T * p = array_p_; + size_ = 0; + max_ = 0; + array_p_ =0; + return p; +} + +template INLINE +Array +Array::slice (int lower, int upper) +{ + assert (lower >= 0 && lower <=upper&& upper <= size_); + Array r; + int s =upper-lower; + r.set_size (s); + arrcpy (r.array_p_, array_p_ + lower, s); + return r; +} + diff --git a/flower/include/link.icc b/flower/include/link.icc index df560285f2..4b3c886aad 100644 --- a/flower/include/link.icc +++ b/flower/include/link.icc @@ -10,11 +10,11 @@ Link::OK() const #ifndef NDEBUG if (previous_) { - assert (previous_->next_ == this); + assert (previous_->next_ == this); } if (next_) { - assert (next_->previous_ == this); + assert (next_->previous_ == this); } #endif } @@ -60,7 +60,7 @@ Link::add (const T& thing) Link* l = new Link(this, next_, thing); if (next_) - next_->previous_ = l; + next_->previous_ = l; next_ = l; } @@ -72,7 +72,7 @@ Link::insert (const T& thing) // bugfix hwn 16/9/96 Link* l = new Link(previous_, this, thing); if (previous_) - previous_->next_ = l; + previous_->next_ = l; previous_ = l; } @@ -84,14 +84,14 @@ inline void Link::remove (List &l) { if (previous_) - previous_->next_ = next_; + previous_->next_ = next_; else - l.top_ = next_; + l.top_ = next_; if (next_) - next_->previous_ = previous_; + next_->previous_ = previous_; else - l.bottom_ = previous_; + l.bottom_ = previous_; } template diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 77a69b519a..79ef5e6a7f 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -16,10 +16,10 @@ an array of pointers. TODO - should init to 0. Derive from Array? + should init to 0. */ template -class Link_array : public Array +class Link_array : private Array { static default_compare (T *const& p1, T *const&p2) { /* can't do p1 -p2, since T might be an incomplete type */ @@ -29,13 +29,64 @@ class Link_array : public Array return 1; return 0; } + Link_array (Array v) + :Array (v) + { + } public: + Link_array() + {} + Link_array (Link_array const &src) + : Array (src) + { + } + /// access element + T *elem (int i) const + { + return elem_ref (i); + } + T *&elem_ref (int i) const + { + return (T*&) Array::elem_ref (i); + } + + /// access element + T* &operator[] (int i) + { + return (T*&) Array::elem_ref (i); + } + /// access element + T *const operator[] (int i) const + { + return (T *const) Array::elem (i); + } + T *pop () + { + return (T*) Array::pop (); + } + void insert (T *t, int i) + { + Array::insert (t, i); + } + void push (T* t) + { + Array::push (t); + } + /// return last entry + T* top (int j=0) const + { + return (T*) Array::top (j); + } + T *& top (int i=0) + { + return (T*&) Array::top (i); + } void substitute (T *old, T*new_l) { int i; while ((i = find_i (old)) >=0) if (new_l) - elem (i) =new_l; + elem_ref (i) =new_l; else del (i); } @@ -44,7 +95,7 @@ public: int i; while ((i = find_i (old)) >=0) if (new_l) - elem (i) =new_l; + elem_ref (i) =new_l; else { unordered_del (i); } @@ -53,6 +104,10 @@ public: void default_sort() { sort (default_compare); } + // quicksort. + void sort (int (*compare)(T *const&,T *const&), + int lower = -1, int upper = -1); + void uniq() { Link_array l_arr; for (int i=0; i < size(); i++) @@ -60,7 +115,26 @@ public: l_arr.push (elem (i)); *this = l_arr; } - + Array::del; + Array::unordered_del; + Array::size; + Array::clear; + Array::set_size; + Array::empty; + Array::reverse; + T * get (int i) + { + return (T*) Array::get (i); + } + Link_array + slice(int l,int u) + { + return Array::slice (l,u); + } + void concat (Link_array const &a2) + { + Array::concat (a2); + } int find_i (T const * t) const { for (int i=0; i < size(); i++) if (elem (i) == t) @@ -75,6 +149,7 @@ public: else return 0; } + }; template @@ -88,5 +163,27 @@ typecast_array (Link_array const &a, T * /* dummy */ ) } + +template inline void +Link_array::sort (int (*compare)(T *const&,T *const&), + int lower = -1, int upper = -1) +{ + if (lower < 0) + { + lower = 0 ; + upper = size () - 1; + } + if (lower >= upper) + return; + swap (lower, (lower+upper)/2); + int last = lower; + for (int i= lower +1; i <= upper; i++) + if (compare (elem (i), elem(lower)) < 0) + swap (++last,i); + swap (lower, last); + sort (compare, lower, last-1); + sort (compare, last+1, upper); +} + #endif // PARRAY_HH diff --git a/input/test/chord-preserve.ly b/input/test/chord-preserve.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/test/ly2dvi-testpage.ly b/input/test/ly2dvi-testpage.ly new file mode 100644 index 0000000000..ba3e51f172 --- /dev/null +++ b/input/test/ly2dvi-testpage.ly @@ -0,0 +1,40 @@ + +%{ + Test ly2dvi features. +%} + +\header { +copyright = "copyright"; +title = "title"; +subtitle = "subtitle"; +composer = "composer"; +arranger = "arranger"; +instrument = "instrument"; +metre = "metre"; +opus = "opus"; +piece = "piece"; +poet = "poet"; +} + + +\score { + \notes { c1 c1 c1 c1 } +} + +\score { + \notes { c1 c1 c1 c1 } + + \header { + + title = "localtitle"; + subtitle = "localsubtitle"; + composer = "localcomposer"; + arranger = "localarranger"; + instrument = "localinstrument"; + metre = "localmetre"; + opus = "localopus"; + piece = "localpiece"; + poet = "localpoet"; + copyright = "localcopyright"; + } +} diff --git a/input/test/span-bars.ly b/input/test/span-bars.ly new file mode 100644 index 0000000000..5c7fb2c324 --- /dev/null +++ b/input/test/span-bars.ly @@ -0,0 +1,23 @@ + +\version "1.0.14"; +nt = \notes { c1 \break c1 c1 } +stuff = \notes \relative c'' < + \type Staff = stone { \nt } + \type Staff = sttwo { \nt } +> + +\score{ + \type StaffGroup \stuff +} + +\score{ + \type StaffGroup < \type GrandStaff \stuff + \type Staff = stthree \nt + > +} + +\score{ + \type ChoirStaff \stuff +} + + diff --git a/lily/GNUmakefile b/lily/GNUmakefile index c61ab3e81e..1de3dc99c2 100644 --- a/lily/GNUmakefile +++ b/lily/GNUmakefile @@ -8,6 +8,9 @@ SUBDIRS = include MODULE_LIBS=$(depth)/lib $(depth)/flower MODULE_INCLUDES=$(depth)/lib/include $(depth)/flower/include +MODULE_CXXFLAGS= + + STEPMAKE_TEMPLATES= c++ executable po diff --git a/lily/abbrev.cc b/lily/abbrev.cc index 04eb7dec72..af2849d91a 100644 --- a/lily/abbrev.cc +++ b/lily/abbrev.cc @@ -13,6 +13,7 @@ #include "paper-def.hh" #include "lookup.hh" #include "stem.hh" +#include "offset.hh" Abbreviation::Abbreviation () { @@ -44,15 +45,15 @@ Abbreviation::do_brew_molecule_p () const } Real sl = slope_f * internote_f; - Atom a (lookup_l ()->beam (sl, w, beam_f)); + Molecule a (lookup_l ()->beam (sl, w, beam_f)); a.translate (Offset (-w/2, w / 2 * slope_f)); Molecule *beams= new Molecule; for (int i = 0; i < abbrev_flags_i_; i++) { - Atom b (a); + Molecule b (a); b.translate_axis (interbeam_f * i, Y_AXIS); - beams->add_atom (b); + beams->add_molecule (b); } beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS); diff --git a/lily/abbreviation-beam.cc b/lily/abbreviation-beam.cc index 94aa9f4d08..c2e2650da2 100644 --- a/lily/abbreviation-beam.cc +++ b/lily/abbreviation-beam.cc @@ -13,7 +13,7 @@ #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" -#include "atom.hh" + #include "molecule.hh" #include "leastsquares.hh" #include "stem.hh" diff --git a/lily/atom.cc b/lily/atom.cc index 0d71f4e240..119f2315ff 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -14,109 +14,101 @@ #include "dimensions.hh" #include "lookup.hh" #include "main.hh" +#include "global-ctor.hh" -inline bool -Atom::check_infinity_b ()const +Atom::Atom(SCM s) { - bool ridiculous = false; - -#ifndef NDEBUG - /* infinity checks. */ - for (int a = X_AXIS; a < NO_AXES; a++) - { - Axis ax = (Axis)a; - if (abs (off_[ax]) >= 100 CM) - { - warning (_f ("ridiculous dimension: %s, %s", axis_name_str (ax), - print_dimen (off_[ax]))); - - if (experimental_features_global_b) - assert (false); - - ( (Atom*)this)->off_[ax] = 0.0; - ridiculous = true; - } - } -#endif - return ridiculous; + func_ = s; } -void -Atom::print () const +#if 0 +int +Atom::smob_display (SCM smob, SCM port, scm_print_state*) { -#ifndef NPRINT - DOUT << "string: " << str_ << '\n'; - - DOUT << "dim:"; - for (Axis i=X_AXIS; i < NO_AXES; incr (i)) - DOUT << axis_name_str (i) << " = " << dim_[i].str (); + Atom* a =(Atom*) SCM_CDR(smob); + String i (a->off_.str ()); + + scm_puts ("#func_); + scm_puts (">", port); - DOUT << "\noffset: " << off_.str (); -#endif + /* non-zero means success */ + return 1; } -Box -Atom::extent () const + +scm_sizet +Atom::smob_free (SCM smob) { - Box b (dim_); - b.translate (off_); - return b; + Atom * a= (Atom*) SCM_CDR(smob); + delete a; + return sizeof (Atom); } -Interval -Atom::extent (Axis a) const +SCM +Atom::smob_mark (SCM smob) { - return dim_[a] + off_[a]; + Atom * a= (Atom*) SCM_CDR(smob); + scm_gc_mark (a->func_); + return a->font_; } +long Atom::smob_tag_; - -Atom::Atom () - : dim_ (Interval (0,0),Interval (0,0)) +void +Atom::init_smob () { - str_ = "unknown\n"; - origin_l_ = 0; -} + static scm_smobfuns type_rec; -Atom::Atom (String s, Box b) - : dim_ (b) -{ - str_ = s; - origin_l_ = 0; + type_rec.mark = smob_mark; + type_rec.free = smob_free; + type_rec.print = smob_display; + type_rec.equalp = 0; + + smob_tag_ = scm_newsmob (&type_rec); } -String -Atom::str () const +SCM +Atom::make_smob () const { - return String ("Atom (\'") + str_ + "\', (" + dim_.x ().str () + ", " - + dim_.y ().str () + "))"; + SCM smob; + SCM_NEWCELL (smob); + SCM_SETCAR (smob, smob_tag_); + SCM_SETCDR (smob, this); + return smob; } -Offset -Atom::offset () const +SCM +Atom::make_atom (SCM outputfunc) { - check_infinity_b (); - return off_; + Atom * a= new Atom(outputfunc); + return a->make_smob (); } -void -Atom::translate_axis (Real r, Axis a) +SCM +Atom::copy_self () const { - off_[a] += r; - check_infinity_b (); + return (new Atom (*this))->make_smob (); } -void -Atom::translate (Offset o) +bool +Atom::Atom_b (SCM obj) { - off_ += o; - check_infinity_b (); + return(SCM_NIMP(obj) && SCM_CAR(obj) == smob_tag_); } -bool -Atom::empty() const +Atom* +Atom::atom_l (SCM a) { - return (dim_.y().length() == 0); + assert (Atom_b (a)); + return (Atom*) SCM_CDR(a); } + + +ADD_GLOBAL_CTOR_WITHNAME(atomsmob, Atom::init_smob); +#endif + + diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 41a4330de4..5d3993f232 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -119,7 +119,7 @@ Bar_engraver::do_process_requests() else if (!now_mom ()) { create_bar (); - bar_p_->type_str_ = ""; + bar_p_->type_str_ = "|"; } else { diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 54ef0e0c77..433e82126e 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -18,7 +18,7 @@ Bar_number_engraver::Bar_number_engraver() axis_ = Y_AXIS; type_ = "barNumber"; visibility_lambda_ - = gh_eval_str ("(lambda (d) (if (= d 1) '(#f . #f) '(#t . #t)))"); + = gh_eval_str ("postbreak_only_visibility"); } void diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index cf741641df..e197da6a9c 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -19,7 +19,7 @@ Bar_script_engraver::Bar_script_engraver () staff_side_p_ = 0; text_p_ =0; visibility_lambda_ - = gh_eval_str ("(lambda (d) (if (= d -1) '(#t . #t) '(#f . #f)))"); + = gh_eval_str ("non_postbreak_visibility"); } void diff --git a/lily/bar.cc b/lily/bar.cc index d8a3d2f72d..0bb7365076 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -51,6 +51,9 @@ static char const *bar_breaks[][3] ={ {":|", ":|", ""}, {"||", "||", ""}, {".|.", ".|.", ""}, + {"", "scorebar", "|"}, + {"", "{", "{"}, + {"", "[", "["}, {0,0,0} }; diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc new file mode 100644 index 0000000000..1f90617969 --- /dev/null +++ b/lily/base-span-bar-engraver.cc @@ -0,0 +1,91 @@ +/* + span-bar-grav.cc -- implement Base_span_bar_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997--1998 Han-Wen Nienhuys +*/ + +#include "span-bar.hh" +#include "base-span-bar-engraver.hh" +#include "vertical-align-spanner.hh" + +Base_span_bar_engraver::Base_span_bar_engraver() +{ + spanbar_p_ =0; + valign_l_ =0; + use_priority_b_ = true; + break_priority_i_ = 0; +} + +Span_bar* +Base_span_bar_engraver::get_span_bar_p() const +{ + return new Span_bar; +} + + +void +Base_span_bar_engraver::acknowledge_element (Score_element_info i) +{ + int depth = i.origin_grav_l_arr_.size(); + if (depth > 1 + && dynamic_cast (i.elem_l_)) + { + bar_l_arr_.push (dynamic_cast (i.elem_l_)); + + if (bar_l_arr_.size() >= 2 && !spanbar_p_) + /* + hmm, i do want a bracket with one staff some times, but not always + if (bar_l_arr_.size() >= 1 && !spanbar_p_) + + --jcn + */ + + /* + + use a property? get_property ("singleStaffBracket", 0) ? + + --hwn + */ + { + spanbar_p_ = get_span_bar_p(); + + if (use_priority_b_) + { + spanbar_p_->break_priority_i_ = break_priority_i_; + } + else + { + spanbar_p_->dim_cache_[X_AXIS].parent_l_ = &bar_l_arr_[0]->dim_cache_[X_AXIS]; + } + + announce_element (Score_element_info (spanbar_p_,0)); + if (spanbar_p_->type_str_.empty_b ()) + spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_; + } + } + else if (dynamic_cast (i.elem_l_) + && i.origin_grav_l_arr_.size() <= 2) + { + valign_l_ = dynamic_cast (i.elem_l_); + } +} + +void +Base_span_bar_engraver::do_pre_move_processing() +{ + if (spanbar_p_) + { + for (int i=0; i < bar_l_arr_.size() ; i++) + spanbar_p_->add_bar (bar_l_arr_[i]); + spanbar_p_->set_align (valign_l_); + typeset_element (spanbar_p_); + spanbar_p_ =0; + } + bar_l_arr_.set_size (0); +} + + + +ADD_THIS_TRANSLATOR(Base_span_bar_engraver); diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 66a90faec7..4bd2e9e591 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -22,6 +22,7 @@ Beam_engraver::Beam_engraver () finished_grouping_p_ = 0; grouping_p_ =0; reqs_drul_[LEFT] = reqs_drul_[RIGHT] =0; + prev_start_req_ =0; } bool @@ -50,6 +51,7 @@ Beam_engraver::do_process_requests () { if (!beam_p_) reqs_drul_[STOP]->warning (_("No beam to end")); + prev_start_req_ =0; finished_beam_p_ = beam_p_; finished_grouping_p_ = grouping_p_; @@ -111,7 +113,11 @@ Beam_engraver::typeset_beam () void Beam_engraver::do_post_move_processing () { - reqs_drul_ [START] =0; + if (reqs_drul_[START]) + { + prev_start_req_ = reqs_drul_[START]; + reqs_drul_ [START] =0; + } } void @@ -126,7 +132,7 @@ Beam_engraver::do_removal_processing () typeset_beam (); if (beam_p_) { - warning (_ ("Unfinished beam")); + prev_start_req_->warning (_ ("Unfinished beam")); finished_beam_p_ = beam_p_; finished_grouping_p_ = grouping_p_; typeset_beam (); diff --git a/lily/beam.cc b/lily/beam.cc index 0c4447664e..094ca9f855 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -26,7 +26,7 @@ #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" -#include "atom.hh" + #include "molecule.hh" #include "leastsquares.hh" #include "stem.hh" @@ -629,15 +629,15 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const */ Real w = here->hpos_f () - prev->hpos_f (); w = w/2 beam (sl, w, beam_f); a.translate (Offset (-w, -w * sl)); for (int j = 0; j < lhalfs; j++) { - Atom b (a); + Molecule b (a); b.translate_axis (-dir_ * dy * (lwholebeams+j), Y_AXIS); - leftbeams.add_atom (b); + leftbeams.add_molecule (b); } } @@ -647,7 +647,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const int rwholebeams = here->beams_i_drul_[RIGHT] beams_i_drul_[LEFT]; Real w = next->hpos_f () - here->hpos_f (); - Atom a = lookup_l ()->beam (sl, w + stemdx, beam_f); + Molecule a = lookup_l ()->beam (sl, w + stemdx, beam_f); a.translate_axis( - stemdx/2, X_AXIS); int j = 0; Real gap_f = 0; @@ -656,9 +656,9 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const int nogap = rwholebeams - here->beam_gap_i_; for (; j < nogap; j++) { - Atom b (a); + Molecule b (a); b.translate_axis (-dir_ * dy * j, Y_AXIS); - rightbeams.add_atom (b); + rightbeams.add_molecule (b); } // TODO: notehead widths differ for different types gap_f = nw_f / 2; @@ -668,9 +668,9 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const for (; j < rwholebeams; j++) { - Atom b (a); + Molecule b (a); b.translate (Offset (gap_f, -dir_ * dy * j)); - rightbeams.add_atom (b); + rightbeams.add_molecule (b); } w = w/2 get_var ("slur_thickness"); Array c = get_controls (); Real dy = c[3].y () - c[0].y (); - Atom a; + Molecule a; if (!dash_i_) a = lookup_l ()->slur (c); @@ -56,7 +56,7 @@ Bow::do_brew_molecule_p () const a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT])); Molecule* mol_p = new Molecule; - mol_p->add_atom (a); + mol_p->add_molecule (a); mol_p->translate_axis (-interstaff_f_, Y_AXIS); return mol_p; diff --git a/lily/boxes.cc b/lily/boxes.cc index 92c8fa6c5a..af9d230e0b 100644 --- a/lily/boxes.cc +++ b/lily/boxes.cc @@ -30,6 +30,13 @@ Box::Box() { } +void +Box::set_empty () +{ + interval_a_[X_AXIS].set_empty (); + interval_a_[Y_AXIS].set_empty (); +} + Box::Box (Interval ix, Interval iy) { x() = ix; diff --git a/lily/break.cc b/lily/break.cc index f6c374dce5..dd88023ec6 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -103,7 +103,8 @@ Break_algorithm::find_breaks () const Line_spacer* Break_algorithm::generate_spacing_problem (Line_of_cols curline, Interval line) const { - Spring_spacer * sp= (Spring_spacer*) (*get_line_spacer) (); // ugh + // ugh + Spring_spacer * sp= dynamic_cast ((*get_line_spacer) ()); sp->paper_l_ = pscore_l_->paper_l_; sp->add_column (curline[0], true, line[LEFT]); @@ -146,7 +147,7 @@ Break_algorithm::feasible (Line_of_cols curline) const for (int i=0; i < curline.size (); i++) { if (i && i < curline.size () -1 - && (((Score_column*)curline[i])->break_penalty_i () >= Break_req::FORCE)) + && ((dynamic_cast(curline[i]))->break_penalty_i () >= Break_req::FORCE)) return false; } return true; diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index 81352999e6..028d19f69f 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -15,8 +15,9 @@ void Change_iterator::error (String reason) { - String to_type = change_l ()->change_to_type_str_; - String to_id = change_l ()->change_to_id_str_; + Change_translator const * t = dynamic_cast (music_l_); + String to_type = t->change_to_type_str_; + String to_id = t->change_to_id_str_; String warn1 = _f ("can't change `%s\' to `%s\'", to_type, to_id) + ": " + reason; @@ -24,13 +25,7 @@ Change_iterator::error (String reason) + report_to_l ()->type_str_ + " = `" + report_to_l ()->id_str_ + "\': "; warning (warn2); - change_l ()->warning (warn1); -} - -Change_translator * -Change_iterator::change_l () -{ - return (Change_translator*) music_l_; + t->warning (warn1); } /* @@ -42,8 +37,9 @@ Change_iterator::do_process_and_next (Moment m) Translator_group * current = report_to_l (); Translator_group * last = 0; - String to_type = change_l ()->change_to_type_str_; - String to_id = change_l ()->change_to_id_str_; + Change_translator const * t = dynamic_cast (music_l_); + String to_type = t->change_to_type_str_; + String to_id = t->change_to_id_str_; /* find the type of translator that we're changing. diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 5e5fee9cbf..3f76f6f0c3 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -12,7 +12,6 @@ #include "molecule.hh" #include "paper-def.hh" #include "lookup.hh" -#include "clef-engraver.hh" #include "g-text-item.hh" #include "p-score.hh" @@ -78,10 +77,8 @@ Clef_item::do_brew_molecule_p() const String t = symbol_; if (change_b_) t += "_change"; - // Atom s = lookup_l ()-> text ("roman", to_str (break_status_dir ())); - - Atom s = lookup_l ()->clef (t); - Molecule*output = new Molecule (Atom (s)); + + Molecule*output = new Molecule (lookup_l ()->clef (t)); return output; } diff --git a/lily/collision.cc b/lily/collision.cc index 149e39fc23..db99d7b4c7 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -155,7 +155,8 @@ Collision::do_pre_processing() (shaddup) */ Offset o (x_off[j] * wid_f, y_off[j] * inter_f); - ((Score_element*)col_l_a[j])->translate (o); + col_l_a[j]->translate (o); + // ((Score_element*)col_l_a[j])->translate (o); } } } diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 47eff97b90..024a697c17 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -14,7 +14,7 @@ #include "debug.hh" #include "score-column.hh" -Crescendo::Crescendo() +Crescendo::Crescendo () { grow_dir_ =0; dir_ = DOWN; @@ -22,17 +22,17 @@ Crescendo::Crescendo() } Interval -Crescendo::symbol_height() const +Crescendo::symbol_height () const { - return get_symbol().dim_[Y_AXIS]; + return get_symbol ().dim_[Y_AXIS]; } static Real absdyn_dim = 10 PT; // ugh -Atom -Crescendo::get_symbol() const +Molecule +Crescendo::get_symbol () const { - Real w_dim = extent(X_AXIS).length (); + Real w_dim = extent (X_AXIS).length (); if (dyn_b_drul_[LEFT]) { w_dim -= absdyn_dim; @@ -44,24 +44,24 @@ Crescendo::get_symbol() const if (w_dim < 0) { - warning (_ ("crescendo") + " " + _("too small")); + warning (_ ("crescendo") + " " + _ ("too small")); w_dim = 0; } Drul_array broken; Direction d = LEFT; do { - Score_column* s = (Score_column* )spanned_drul_[d] ; // UGH - broken[d] = (!s->musical_b()); - } while (flip(&d) != LEFT); + Score_column* s = dynamic_cast(spanned_drul_[d]); // UGH + broken[d] = (!s->musical_b ()); + } while (flip (&d) != LEFT); - bool continued = broken[(Direction)-grow_dir_]; - return Atom (lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued)); + bool continued = broken[Direction (-grow_dir_)]; + return Molecule (lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued)); } Molecule* -Crescendo::do_brew_molecule_p() const +Crescendo::do_brew_molecule_p () const { Molecule* m_p =0; Real x_off_dim=0.0; @@ -69,8 +69,8 @@ Crescendo::do_brew_molecule_p() const x_off_dim += absdyn_dim; m_p = new Molecule; - Atom s (get_symbol()); - m_p->add_atom (s); + Molecule s (get_symbol ()); + m_p->add_molecule (s); m_p->translate (Offset (x_off_dim, coordinate_offset_f_)); return m_p; } diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index 8746337cca..6713e82b19 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -13,6 +13,7 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d) { init(); empty_b_ = d.empty_b_; + offset_ = d.offset_; //let's hope others will copy the refpoint appropriately. } Dimension_cache::Dimension_cache () diff --git a/lily/dots.cc b/lily/dots.cc index 1a40a51570..ea37e88f11 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -33,18 +33,18 @@ Molecule* Dots::do_brew_molecule_p () const { Molecule *out = new Molecule; - Atom fill = lookup_l ()->fill (Box (Interval (0,0), + Molecule fill = lookup_l ()->fill (Box (Interval (0,0), Interval (0,0))); - out->add_atom (fill); + out->add_molecule (fill); - Atom d = lookup_l ()->dots (); + Molecule d = lookup_l ()->dots (); Real dw = d.dim_[X_AXIS].length (); d.translate_axis (-dw, X_AXIS); for (int i=no_dots_i_; i--; ) { d.translate_axis (2*dw,X_AXIS); - out->add_atom (d); + out->add_molecule (d); } Real inter_f = paper ()->internote_f (); out->translate_axis (inter_f * position_i_, Y_AXIS); diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index d36eeb250a..bf7a654295 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -92,10 +92,10 @@ Dynamic_engraver::do_process_requests() continue; } - String loud = absd->loudness_str (); + String loud = absd->loudness_str_; text_p_ = new G_text_item; - text_p_->text_str_ = "dyn" + loud; // ugh + text_p_->text_str_ = loud; // ugh Scalar prop = get_property ("dynamicStyle", 0); text_p_->style_str_ = prop.length_i () ? prop : "dynamic"; diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index a255c4c5cd..ab01127f61 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -30,11 +30,9 @@ Engraver_group_engraver::do_announces() Link_array groups = group_l_arr (); for (int i=0; i < groups.size(); i++) { - Engraver * eng = dynamic_cast (groups[i]); - if (eng) + Engraver_group_engraver * group = dynamic_cast (groups[i]); + if (group) { - Engraver_group_engraver * group = - (Engraver_group_engraver*) eng; group->do_announces(); } } diff --git a/lily/engraver.cc b/lily/engraver.cc index 762d800ed4..947209376b 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -11,6 +11,7 @@ #include "engraver.hh" #include "engraver-group.hh" #include "debug.hh" +#include "paper-def.hh" void Engraver::fill_staff_info (Staff_info&) @@ -36,7 +37,7 @@ Engraver::typeset_element (Score_element*p) Paper_def* Engraver::paper() const { - return (Paper_def*)output_def_l_; + return dynamic_cast(output_def_l_); } diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index 7c727b128c..9be7106bef 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -6,7 +6,7 @@ (c) 1998 Jan Nieuwenhuizen */ -#include "atom.hh" + #include "box.hh" #include "debug.hh" #include "lookup.hh" @@ -52,12 +52,11 @@ Extender_spanner::do_brew_molecule_p () const Real w = extent (X_AXIS).length (); w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]); - - Atom a = lookup_l ()->extender (w); - + Real h = paper ()->get_realvar (ly_symbol ("extender_height")); + Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h))); a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT])); - mol_p->add_atom (a); + mol_p->add_molecule (a); return mol_p; } diff --git a/lily/g-text-item.cc b/lily/g-text-item.cc index 26751aecb9..8d9d9cf152 100644 --- a/lily/g-text-item.cc +++ b/lily/g-text-item.cc @@ -8,7 +8,7 @@ */ #include "g-text-item.hh" -#include "atom.hh" + #include "molecule.hh" #include "paper-def.hh" #include "lookup.hh" @@ -16,7 +16,7 @@ Molecule* G_text_item::do_brew_molecule_p () const { - Atom a= paper ()->lookup_l(0)->text (style_str_,text_str_); + Molecule a= paper ()->lookup_l(0)->text (style_str_,text_str_); return new Molecule (a); } diff --git a/lily/general-script-def.cc b/lily/general-script-def.cc index 3ce45fbf5c..360a0123f0 100644 --- a/lily/general-script-def.cc +++ b/lily/general-script-def.cc @@ -6,10 +6,10 @@ (c) 1997--1998 Han-Wen Nienhuys */ - +#include "molecule.hh" #include "general-script-def.hh" #include "debug.hh" -#include "atom.hh" + Direction General_script_def::staff_dir() const @@ -60,19 +60,13 @@ General_script_def::do_print() const { } -Atom -General_script_def::get_atom (Paper_def*, Direction) const +Molecule +General_script_def::get_molecule (Paper_def*, Direction) const { - Atom s; - return Atom (s); + Molecule s; + return Molecule (s); } -Interval -General_script_def::width (Paper_def*) const -{ - Interval t; - return t; -} diff --git a/lily/global-ctor.cc b/lily/global-ctor.cc new file mode 100644 index 0000000000..562bd6131f --- /dev/null +++ b/lily/global-ctor.cc @@ -0,0 +1,27 @@ +/* + global-ctor.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ +#include "global-ctor.hh" +#include "array.hh" + +static Array *ctor_global_static_arr_p_; + +void +add_constructor (Global_ctor c) +{ + if (!ctor_global_static_arr_p_) + ctor_global_static_arr_p_ = new Array; + ctor_global_static_arr_p_->push (c); +} + +void +call_constructors () +{ + for (int i=0; i < ctor_global_static_arr_p_->size (); i++) + (ctor_global_static_arr_p_->elem (i)) (); +} diff --git a/lily/graphical-element.cc b/lily/graphical-element.cc index 921608e9ae..940a972025 100644 --- a/lily/graphical-element.cc +++ b/lily/graphical-element.cc @@ -84,8 +84,7 @@ Graphical_element::set_empty (bool b) Interval Graphical_element::extent (Axis a) const { - Dimension_cache const * d = //(Dimension_cache*) - &dim_cache_[a]; + Dimension_cache const * d = &dim_cache_[a]; if (d->empty_b ()) return Interval (); diff --git a/lily/grouping.cc b/lily/grouping.cc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/include/atom.hh b/lily/include/atom.hh index 22c5d15a0c..b4f656094a 100644 --- a/lily/include/atom.hh +++ b/lily/include/atom.hh @@ -13,32 +13,46 @@ #include "string.hh" #include "box.hh" #include "lily-proto.hh" +#include "lily-guile.hh" +#if 0 /// a symbol which can be translated, and freely copied class Atom { + static long smob_tag_; + + static SCM smob_mark (SCM); + static scm_sizet smob_free (SCM); + static int smob_display (SCM, SCM, scm_print_state*); + Atom (SCM s); + SCM make_smob () const; +public: Offset off_; + static SCM make_atom (SCM outputfunc); + SCM copy_self () const; + static Atom *atom_l (SCM); + + /// Is #obj# a Foo? + static bool Atom_b(SCM obj); + static void init_smob (); + SCM func_; + SCM font_; +}; + +#else + +class Atom { public: - Protected_scm lambda_; - Score_element * origin_l_; - - // urg, only used as a temp buffer - String str_; - String font_; - Box dim_; - - Offset offset () const; - String str() const; // for printing. - Atom (String, Box); - Atom (); - void translate (Offset o); - void translate_axis (Real r,Axis a); - /// how big is #this#? - Box extent() const; - Interval extent (Axis)const; - void print() const; - bool check_infinity_b () const; - bool empty() const; + Atom (SCM s); + Offset off_; + /* + SCM expression that (when evaluated) gives a TeX string +representing a musical notation symbol. */ + Protected_scm func_; + Protected_scm font_; }; + +#endif + #endif diff --git a/lily/include/base-span-bar-engraver.hh b/lily/include/base-span-bar-engraver.hh new file mode 100644 index 0000000000..6d8ddf71ed --- /dev/null +++ b/lily/include/base-span-bar-engraver.hh @@ -0,0 +1,44 @@ +/* + base-span-bar-engraver.hh -- declare Span_bar_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997--1998 Han-Wen Nienhuys +*/ + + +#ifndef SPAN_BAR_GRAV_HH +#define SPAN_BAR_GRAV_HH + +#include "engraver.hh" + +/** + + Make bars that span multiple "staffs". Catch bars, and span a + Span_bar over them if we find more than 2 bars + + */ +class Base_span_bar_engraver : public Engraver +{ + Span_bar * spanbar_p_; + Array bar_l_arr_; + Vertical_align_spanner * valign_l_; +public: + VIRTUAL_COPY_CONS(Translator); + + + Base_span_bar_engraver(); +protected: + /** + Do we use break priorities? If true, use break_priority_i_ as + horizontal alignment priority, otherwise, hang the spanbar on the + acknowledged bar. */ + bool use_priority_b_; + int break_priority_i_; + + virtual void acknowledge_element (Score_element_info); + virtual void do_pre_move_processing(); + virtual Span_bar* get_span_bar_p() const; +}; + +#endif // SPAN_BAR_GRAV_HH diff --git a/lily/include/beam-engraver.hh b/lily/include/beam-engraver.hh index 898e8b048d..5bd35d4b94 100644 --- a/lily/include/beam-engraver.hh +++ b/lily/include/beam-engraver.hh @@ -18,7 +18,7 @@ class Beam_engraver : public Engraver { Beam *finished_beam_p_; Beam *beam_p_; - + Beam_req * prev_start_req_; Rhythmic_grouping*grouping_p_; Rhythmic_grouping*finished_grouping_p_; diff --git a/lily/include/box.hh b/lily/include/box.hh index b26c6e3695..c53543d058 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -24,6 +24,7 @@ struct Box { void translate (Offset o); /// smallest box enclosing #b# + void set_empty (); void unite (Box b); Box(); Box (Interval ix, Interval iy); diff --git a/lily/include/change-iterator.hh b/lily/include/change-iterator.hh index 9dec9ba80c..6a703ac313 100644 --- a/lily/include/change-iterator.hh +++ b/lily/include/change-iterator.hh @@ -15,7 +15,6 @@ class Change_iterator : public Music_iterator { - Change_translator *change_l (); void error (String); protected: diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index 964933e2df..ee770c3b3d 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -7,10 +7,10 @@ #ifndef COLHPOS_HH #define COLHPOS_HH -#include "array.hh" +#include "parray.hh" #include "lily-proto.hh" -typedef Array Line_of_cols; +typedef Link_array Line_of_cols; struct Column_x_positions { Line_spacer * spacer_l_; diff --git a/lily/include/cons.cc b/lily/include/cons.cc new file mode 100644 index 0000000000..39ed3095f6 --- /dev/null +++ b/lily/include/cons.cc @@ -0,0 +1,10 @@ +/* + cons.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#include "cons.hh" diff --git a/lily/include/cons.hh b/lily/include/cons.hh new file mode 100644 index 0000000000..4b4de47e55 --- /dev/null +++ b/lily/include/cons.hh @@ -0,0 +1,43 @@ +/* + cons.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef CONS_HH +#define CONS_HH + +template +class Cons +{ +public: + T * car_; + Cons * next_; + virtual ~Cons (); + Cons () { + car_=0; + next_ =0; + } + Cons (T*t, Cons*c) + { + car_ = t; + next_ = c; + } +}; + +template +class Killing_cons : public Cons +{ +public: + Killing_cons (T *t, Cons *p) + : Cons( t,p) + { + } + virtual ~Killing_cons (); +}; + +#endif /* CONS_HH */ + diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index f39f1dbaf7..dec066bef9 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -30,7 +30,7 @@ protected: private: - Atom get_symbol() const; + Molecule get_symbol() const; }; #endif // CRESCENDO_HH diff --git a/lily/include/general-script-def.hh b/lily/include/general-script-def.hh index 2cd36becb6..dde24d58c8 100644 --- a/lily/include/general-script-def.hh +++ b/lily/include/general-script-def.hh @@ -27,11 +27,9 @@ public: virtual Direction rel_stem_dir() const; virtual int priority_i() const; virtual bool inside_b() const; - virtual Atom get_atom (Paper_def* p, Direction dir_) const; + virtual Molecule get_molecule (Paper_def* p, Direction dir_) const; bool equal_b (General_script_def const&) const; virtual ~General_script_def() {} - - virtual Interval width (Paper_def *) const; protected: virtual bool do_equal_b (General_script_def const *) const; virtual void do_print() const; diff --git a/lily/include/global-ctor.hh b/lily/include/global-ctor.hh new file mode 100644 index 0000000000..53d25a4477 --- /dev/null +++ b/lily/include/global-ctor.hh @@ -0,0 +1,32 @@ +/* + global-ctor.hh -- declare Global construction stuff. + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef GLOBAL_CTOR_HH +#define GLOBAL_CTOR_HH + + +#define ADD_GLOBAL_CTOR_WITHNAME(y,x)\ +class Global_ctor_ ## y \ +{\ +public: \ + Global_ctor_ ## y () { \ + add_constructor (x); \ + } \ +} _ ## y ## _ctor_init; \ + + +#define ADD_GLOBAL_CTOR(x) ADD_GLOBAL_CTOR_WITHNAME(x,x); + + +typedef void (* Global_ctor ) (); +void add_constructor (Global_ctor ctor); +void call_constructors (); + +#endif /* GLOBAL_CTOR_HH */ + diff --git a/lily/include/grouping.hh b/lily/include/grouping.hh deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/include/includable-lexer.hh b/lily/include/includable-lexer.hh index 51aa0937ad..23b9724394 100644 --- a/lily/include/includable-lexer.hh +++ b/lily/include/includable-lexer.hh @@ -13,7 +13,7 @@ #include #include "string.hh" -#include "array.hh" +#include "parray.hh" #include "fproto.hh" #include "proto.hh" @@ -29,7 +29,7 @@ class Includable_lexer : public yyFlexLexer protected: bool close_input (); - Array include_stack_; + Link_array include_stack_; Array char_count_stack_; public: diff --git a/lily/include/killing-cons.tcc b/lily/include/killing-cons.tcc new file mode 100644 index 0000000000..3c9a9710e7 --- /dev/null +++ b/lily/include/killing-cons.tcc @@ -0,0 +1,27 @@ +/* + killing-cons.tcc -- declare Killing_cons + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef KILLING_CONS_TCC +#define KILLING_CONS_TCC + +template +Cons::~Cons () +{ +} + +template +Killing_cons::~Killing_cons () +{ + delete car_; + delete next_; +} + + +#endif /* KILLING_CONS_TCC */ + diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh index ab91f4d1f8..b3183efc97 100644 --- a/lily/include/line-of-score.hh +++ b/lily/include/line-of-score.hh @@ -15,7 +15,7 @@ class Line_of_score : public Spanner , public Super_element { public: - Link_array cols; + Link_array cols_; bool error_mark_b_; diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 955ce1e87d..d61766a1f1 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -10,10 +10,8 @@ #ifndef LOOKUP_HH #define LOOKUP_HH -#include "atom.hh" #include "molecule.hh" #include "fproto.hh" -#include "scalar.hh" #include "direction.hh" #include "box.hh" @@ -27,33 +25,34 @@ public: - Atom special_ball (int, String) const; - Atom simple_bar (String s, Real w) const; + Molecule special_ball (int, String) const; + Molecule simple_bar (String s, Real w) const; Molecule accidental (int, bool cautionary) const; - Atom afm_find (String, bool warn=true) const; - Atom ball (int) const; + Molecule afm_find (String, bool warn=true) const; + Molecule ball (int) const; Molecule bar (String, Real height) const; - Atom beam (Real, Real, Real) const; - Atom clef (String) const; - Atom dashed_slur (Array controls, Real thick, Real dash) const; - Atom dots () const; - Atom extender (Real) const; - Atom fill (Box b) const; - Atom flag (int, Direction) const; - Atom hairpin (Real width, bool decresc, bool continued) const; - Atom plet (Real dy, Real dx, Direction dir) const; - Atom rest (int, bool outside) const; - Atom rule_symbol (Real height, Real width) const; - Atom script (String idx) const; - Atom stem (Real y1_pos, Real y2_pos) const; - Atom slur (Array controls) const; - Atom streepje (int type) const; - Atom text (String style, String text) const; - Atom vbrace (Real &dy) const; - Atom vbracket (Real &dy) const; - Atom volta (Real w, bool last_b) const; - Atom special_time_signature (String, Array) const; - Atom time_signature (Array) const; + Molecule beam (Real, Real, Real) const; + Molecule clef (String) const; + Molecule dashed_slur (Array controls, Real thick, Real dash) const; + Molecule dots () const; + Molecule ledger_line (Interval) const; + Molecule fill (Box b) const; + Molecule filledbox (Box b) const; + Molecule flag (int, Direction) const; + Molecule hairpin (Real width, bool decresc, bool continued) const; + Molecule plet (Real dy, Real dx, Direction dir) const; + Molecule rest (int, bool outside) const; + Molecule rule_symbol (Real height, Real width) const; + Molecule script (String idx) const; + Molecule stem (Real y1_pos, Real y2_pos) const; + Molecule slur (Array controls) const; + Molecule streepje (int type) const; + Molecule text (String style, String text) const; + Molecule staff_brace (Real dy) const; + Molecule staff_bracket (Real dy) const; + Molecule volta (Real w, bool last_b) const; + Molecule special_time_signature (String, int,int) const; + Molecule time_signature (int n,int d) const; Paper_def * paper_l_; diff --git a/lily/include/lyric-performer.hh b/lily/include/lyric-performer.hh index 4f83376ad4..baf31a47a9 100644 --- a/lily/include/lyric-performer.hh +++ b/lily/include/lyric-performer.hh @@ -25,7 +25,7 @@ protected: virtual void do_process_requests(); private: - Array lreq_arr_; + Link_array lreq_arr_; }; #endif // LYRIC_PERFOMER_HH diff --git a/lily/include/misc.hh b/lily/include/misc.hh index e659602e99..d45eabe840 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -27,7 +27,7 @@ sign (int i) { #ifndef STANDALONE #include "lily-proto.hh" -Interval itemlist_width (const Array &its); +Interval itemlist_width (const Link_array &its); #endif void set_frobnify (void*, size_t); diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index 757a26ac34..53da1c511a 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -13,29 +13,35 @@ #include "box.hh" #include "axes.hh" #include "direction.hh" +#include "protected-scm.hh" +#include "cons.hh" /** a group of individually translated symbols. You can add molecules to the top, to the right, etc. */ -struct Molecule { - Pointer_list atoms_; // change to List? +class Molecule { + // Protected_scm atom_list_; // change to List? + Killing_cons *atom_list_; + friend class Paper_outputter; +public: + Box dim_; - - Molecule() { } - Molecule (Atom const &a); + Molecule(); + ~Molecule(); void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding); void add_molecule (Molecule const &m); void translate (Offset); + void do_center (Axis); void translate_axis (Real,Axis); - void add_atom (Atom const & a) ; + + void add_atom (Atom const *a); /// how big is #this#? Box extent() const; Interval extent (Axis) const; Molecule (const Molecule&s); void print() const; -private: - void operator=(const Molecule&); + void operator=(const Molecule&); }; #endif diff --git a/lily/include/music-wrapper-iterator.hh b/lily/include/music-wrapper-iterator.hh index 50d9bbea27..fc149876c8 100644 --- a/lily/include/music-wrapper-iterator.hh +++ b/lily/include/music-wrapper-iterator.hh @@ -29,7 +29,6 @@ public: virtual bool ok () const; protected: - Music_wrapper *music_wrapper_l () const; virtual void do_print () const; virtual void do_process_and_next (Moment) ; diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index eea7e90b16..a25dd1d243 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -170,21 +170,12 @@ public: class Dynamic_req : public virtual Musical_req { public: - /** - for absolute dynamics - - This sux. We'd want increasing numbers for FFF till PPP, but not - for FP, SF, SFZ (FP is *not* louder than FFF) - */ - enum Loudness { - FFFFFF, FFFFF, FFFF, FFF, FF, F, MF, MP, P, PP, PPP, PPPP, PPPPP, PPPPPP, FP, SF, SFF, SFZ, SP, SPP, RFZ }; - static String loudness_static_str (Loudness); REQUESTMETHODS(Dynamic_req); }; class Absolute_dynamic_req : public Dynamic_req { public: - Loudness loudness_; + String loudness_str_; virtual bool do_equal_b (Request*) const; String loudness_str () const; Absolute_dynamic_req(); diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index 91e51c635b..c303c258e9 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -36,7 +36,7 @@ public: Notename_table *chordmodifier_tab_p_; Notename_table *note_tab_p_; - Array scope_l_arr_; + Link_array scope_l_arr_; Keyword_table * keytable_p_; int errorlevel_i_; diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 889ccf1bb7..fe5f4480be 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -11,7 +11,7 @@ #define MY_LILY_PARSER_HH #include "lily-proto.hh" #include "string.hh" -#include "array.hh" +#include "parray.hh" #include "lily-proto.hh" #include "lily-proto.hh" #include "duration.hh" @@ -36,7 +36,7 @@ public: bool first_b_; - Array pre_reqs, post_reqs; + Link_array pre_reqs, post_reqs; int fatal_error_i_; Sources * source_l_; int error_level_i_; @@ -52,7 +52,7 @@ public: void do_yyparse(); void parser_error (String); - Array* get_parens_request (int t); + Link_array* get_parens_request (int t); void set_debug(); void set_yydebug (bool); diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 42c580768e..6348379e17 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -39,8 +39,6 @@ public: void stop_line (); void switch_to_font (String fontname); - Array font_arr_; - String current_font_; Paper_stream* outstream_l_; }; diff --git a/lily/include/piano-brace.hh b/lily/include/piano-brace.hh deleted file mode 100644 index c16ed213ec..0000000000 --- a/lily/include/piano-brace.hh +++ /dev/null @@ -1,33 +0,0 @@ -/* - piano-brace.hh -- declare Piano_brace - - source file of the GNU LilyPond music typesetter - - (c) 1998 Han-Wen Nienhuys - - */ - -#ifndef PIANO_BRACE_HH -#define PIANO_BRACE_HH - -#include "span-score-bar.hh" - -class Piano_brace : public Span_score_bar -{ -public: - - VIRTUAL_COPY_CONS(Score_element); - - /** make room for Staff_bracket. Ugh. Should use some kind of - relation thingy. */ - Real extra_move_left_f_; - Piano_brace (); -protected: - virtual Interval do_width() const; - virtual void do_post_processing(); - virtual Molecule get_bar_sym (Real) const; -}; - - -#endif /* PIANO_BRACE_HH */ - diff --git a/lily/include/protected-scm.hh b/lily/include/protected-scm.hh index f02ced787b..eafcc54c9c 100644 --- a/lily/include/protected-scm.hh +++ b/lily/include/protected-scm.hh @@ -24,7 +24,7 @@ public: Protected_scm (Protected_scm const &); ~Protected_scm (); Protected_scm &operator = (Protected_scm const &); - operator SCM (); + operator SCM () const; SCM to_SCM () const; }; diff --git a/lily/include/repeated-music-iterator.hh b/lily/include/repeated-music-iterator.hh index 1e8c48a2d4..9f8b720132 100644 --- a/lily/include/repeated-music-iterator.hh +++ b/lily/include/repeated-music-iterator.hh @@ -23,11 +23,8 @@ public: virtual bool ok () const; protected: - virtual Repeated_music* repeated_music_l () const; - virtual void do_print () const; virtual void do_process_and_next (Moment); - private: void start_next_element (); diff --git a/lily/include/rhythmic-grouping.hh b/lily/include/rhythmic-grouping.hh index 07bca7b9ac..edccad7baf 100644 --- a/lily/include/rhythmic-grouping.hh +++ b/lily/include/rhythmic-grouping.hh @@ -8,14 +8,14 @@ #define RHYTHMIC_GROUPING_HH #include "minterval.hh" -#include "array.hh" +#include "parray.hh" /** data structure which represents rhythmic units this is a tree. It groupes notes according to rules TODO Documentation. Unhairing */ struct Rhythmic_grouping { - Array children; + Link_array children; MInterval *interval_; @@ -28,7 +28,7 @@ struct Rhythmic_grouping { Rhythmic_grouping (Rhythmic_grouping const&); Rhythmic_grouping (MInterval, int n=1); Rhythmic_grouping(); - Rhythmic_grouping (Array); + Rhythmic_grouping (Link_array); ~Rhythmic_grouping(); void add_child (Moment start, Moment len); diff --git a/lily/include/score-bar.hh b/lily/include/score-bar.hh deleted file mode 100644 index 741f1412b9..0000000000 --- a/lily/include/score-bar.hh +++ /dev/null @@ -1,28 +0,0 @@ -/* - score-bar.hh -- declare Score_bar - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys - - */ - -#ifndef SCORE_BAR_HH -#define SCORE_BAR_HH - -#include "bar.hh" - -/** - Score_bars are at the start of the line only, and - they come before normal bars. - */ -class Score_bar : public virtual Bar { -public: - - VIRTUAL_COPY_CONS(Score_element); -protected: - void do_pre_processing (); -}; - -#endif /* SCORE_BAR_HH */ - diff --git a/lily/include/score-element-info.hh b/lily/include/score-element-info.hh index 19586ede51..594e811452 100644 --- a/lily/include/score-element-info.hh +++ b/lily/include/score-element-info.hh @@ -12,7 +12,7 @@ #include "scalar.hh" #include "lily-proto.hh" -#include "array.hh" +#include "parray.hh" /** Data container for broadcasts @@ -20,7 +20,7 @@ struct Score_element_info { Score_element * elem_l_; Music *req_l_; - Array origin_grav_l_arr_; + Link_array origin_grav_l_arr_; Score_element_info (Score_element*, Music*); Score_element_info(); diff --git a/lily/include/script-def.hh b/lily/include/script-def.hh index 1bf61fd493..e7f7697a49 100644 --- a/lily/include/script-def.hh +++ b/lily/include/script-def.hh @@ -34,7 +34,7 @@ public: virtual Direction rel_stem_dir() const; virtual int priority_i() const; virtual bool inside_b() const; - virtual Atom get_atom (Paper_def* p, Direction dir_) const; + virtual Molecule get_molecule (Paper_def* p, Direction dir_) const; virtual bool do_equal_b (General_script_def const *) const; diff --git a/lily/include/script-engraver.hh b/lily/include/script-engraver.hh index afef25c8b7..5e009bbfa3 100644 --- a/lily/include/script-engraver.hh +++ b/lily/include/script-engraver.hh @@ -12,8 +12,8 @@ class Script_engraver : public Engraver { - Array