\begin{document}
\maketitle
+[THIS IS WORK IN PROGRESS. THIS PAPER IS NOT FINISHED]
+
% -*-LaTeX-*-
\section{Introduction}
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
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)
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())
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
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
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 <a' c''> c'' <a' 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
e' ~ e' <c' e' g'> ~ <c' e' g'>
)
+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)
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:
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.
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
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)(
-<c e g>
-)
-
-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
)
+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.
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"
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
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
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,
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.
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.
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.
}
)
+COMMENT(Broken!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
+
)
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(
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)
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
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.
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
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
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).
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(
-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:
* 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<void*>
+ - search repl: Array<X*> -> Link_array<X>
+ - 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
-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
}
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 <a'4.*2/3 d''4.*2/3 fis''4.*2/3> [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 <a'4.*2/3 d''4.*2/3 fis''4.*2/3> [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 }
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<Type> iso MACRO(Type)
-
- - NEWS: ... Musical_pitch (analogous to Duration and Rhythmic_req)
+*** try to use template<Type> 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; <b c> } { <f as b> } >
- * 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
-
- * <c f a>4 ?
-
- * Viola mode?
+*** <c f a>4 ?
+*** Viola mode?
@c c g e g
for
@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
% --|--- --|---
(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 <hanwen@cs.uu.nl> writes:
> mcmanus@IDT.NET writes:
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
"Whenever you find yourself on the side of the majority, it is time to
pause and reflect."
-- Mark Twain
-***********************
+
+
+
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.
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
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2878 "configure"
+#line 2876 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
}
EOF
-if { (eval echo configure:2891: \"$ac_link\") 1>&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
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 <<EOF
-#line 2914 "configure"
+#line 2912 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
; return 0; }
EOF
-if { (eval echo configure:2940: \"$ac_link\") 1>&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
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 <<EOF
-#line 2969 "configure"
+#line 2967 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
; return 0; }
EOF
-if { (eval echo configure:2995: \"$ac_link\") 1>&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
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 <<EOF
-#line 3027 "configure"
+#line 3025 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3053: \"$ac_link\") 1>&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
# 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
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)
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_;
// 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#.
{ 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_);
}
/// 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<size_);
return ((T*)array_p_)[i];
}
+ /// access element
+ T elem (int i) const
+ {
+ return elem_ref (i);
+ }
/// add to the end of array
- void push (T x)
+ void push (T x)
{
if (size_ == max_)
remax (2*max_ + 1);
array_p_[size_++] = x;
}
/// remove and return last entry
- T pop()
+ T pop()
{
assert (!empty());
T l = top (0);
return l;
}
/// access last entry
- T& top (int j=0)
+ T& top (int j=0)
{
return (*this)[size_-j-1];
}
/// return last entry
- T top (int j=0) const
+ T top (int j=0) const
{
return (*this)[size_-j-1];
}
(*this)[i]=(*this)[j];
(*this)[j]=t;
}
- bool empty() const
+ bool empty () const
{ return !size_; }
void insert (T k, int j);
return t;
}
void unordered_del (int i)
-
{
- elem (i) = top();
+ elem_ref (i) = top();
set_size (size() -1);
}
void del (int i)
set_size (size_ + src.size_);
arrcpy (array_p_+s,src.array_p_, src.size_);
}
- Array<T> slice (int lower, int upper)
- {
- assert (lower >= 0 && lower <=upper&& upper <= size_);
- Array<T> r;
- int s =upper-lower;
- r.set_size (s);
- arrcpy (r.array_p_, array_p_ + lower, s);
- return r;
- }
+ Array<T> slice (int lower, int upper) ;
void reverse();
};
swap (i,j);
}
+template<class T> INLINE
+void
+Array<T>::OK() const
+{
+ assert (max_ >= size_ && size_ >=0);
+ if (max_) assert (array_p_);
+}
+
+template<class T> INLINE
+T *
+Array<T>::remove_array_p ()
+{
+ T * p = array_p_;
+ size_ = 0;
+ max_ = 0;
+ array_p_ =0;
+ return p;
+}
+
+template<class T> INLINE
+Array<T>
+Array<T>::slice (int lower, int upper)
+{
+ assert (lower >= 0 && lower <=upper&& upper <= size_);
+ Array<T> r;
+ int s =upper-lower;
+ r.set_size (s);
+ arrcpy (r.array_p_, array_p_ + lower, s);
+ return r;
+}
+
#ifndef NDEBUG
if (previous_)
{
- assert (previous_->next_ == this);
+ assert (previous_->next_ == this);
}
if (next_)
{
- assert (next_->previous_ == this);
+ assert (next_->previous_ == this);
}
#endif
}
Link<T>* l = new Link<T>(this, next_, thing);
if (next_)
- next_->previous_ = l;
+ next_->previous_ = l;
next_ = l;
}
// bugfix hwn 16/9/96
Link<T>* l = new Link<T>(previous_, this, thing);
if (previous_)
- previous_->next_ = l;
+ previous_->next_ = l;
previous_ = l;
}
Link<T>::remove (List<T> &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<class T>
an array of pointers.
TODO
- should init to 0. Derive from Array<void*>?
+ should init to 0.
*/
template<class T>
-class Link_array : public Array<T*>
+class Link_array : private Array<void *>
{
static default_compare (T *const& p1, T *const&p2) {
/* can't do p1 -p2, since T might be an incomplete type */
return 1;
return 0;
}
+ Link_array (Array<void*> v)
+ :Array<void*> (v)
+ {
+ }
public:
+ Link_array()
+ {}
+ Link_array (Link_array<T> const &src)
+ : Array<void*> (src)
+ {
+ }
+ /// access element
+ T *elem (int i) const
+ {
+ return elem_ref (i);
+ }
+ T *&elem_ref (int i) const
+ {
+ return (T*&) Array<void*>::elem_ref (i);
+ }
+
+ /// access element
+ T* &operator[] (int i)
+ {
+ return (T*&) Array<void*>::elem_ref (i);
+ }
+ /// access element
+ T *const operator[] (int i) const
+ {
+ return (T *const) Array<void*>::elem (i);
+ }
+ T *pop ()
+ {
+ return (T*) Array<void*>::pop ();
+ }
+ void insert (T *t, int i)
+ {
+ Array<void*>::insert (t, i);
+ }
+ void push (T* t)
+ {
+ Array<void*>::push (t);
+ }
+ /// return last entry
+ T* top (int j=0) const
+ {
+ return (T*) Array<void*>::top (j);
+ }
+ T *& top (int i=0)
+ {
+ return (T*&) Array<void*>::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);
}
int i;
while ((i = find_i (old)) >=0)
if (new_l)
- elem (i) =new_l;
+ elem_ref (i) =new_l;
else {
unordered_del (i);
}
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<T> l_arr;
for (int i=0; i < size(); i++)
l_arr.push (elem (i));
*this = l_arr;
}
-
+ Array<void*>::del;
+ Array<void*>::unordered_del;
+ Array<void*>::size;
+ Array<void*>::clear;
+ Array<void*>::set_size;
+ Array<void*>::empty;
+ Array<void*>::reverse;
+ T * get (int i)
+ {
+ return (T*) Array<void*>::get (i);
+ }
+ Link_array<T>
+ slice(int l,int u)
+ {
+ return Array<void*>::slice (l,u);
+ }
+ void concat (Link_array<T> const &a2)
+ {
+ Array<void*>::concat (a2);
+ }
int find_i (T const * t) const {
for (int i=0; i < size(); i++)
if (elem (i) == t)
else
return 0;
}
+
};
template<class T, class V>
}
+
+template<class T> inline void
+Link_array<T>::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
--- /dev/null
+
+%{
+ 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";
+ }
+}
--- /dev/null
+
+\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
+}
+
+
MODULE_LIBS=$(depth)/lib $(depth)/flower
MODULE_INCLUDES=$(depth)/lib/include $(depth)/flower/include
+MODULE_CXXFLAGS=
+
+
STEPMAKE_TEMPLATES= c++ executable po
#include "paper-def.hh"
#include "lookup.hh"
#include "stem.hh"
+#include "offset.hh"
Abbreviation::Abbreviation ()
{
}
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);
#include "abbreviation-beam.hh"
#include "misc.hh"
#include "debug.hh"
-#include "atom.hh"
+
#include "molecule.hh"
#include "leastsquares.hh"
#include "stem.hh"
#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 ("#<Atom ", port);
+ scm_puts (i.ch_C(), port);
+ gh_display (a->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
+
+
else if (!now_mom ())
{
create_bar ();
- bar_p_->type_str_ = "";
+ bar_p_->type_str_ = "|";
}
else
{
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
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
{":|", ":|", ""},
{"||", "||", ""},
{".|.", ".|.", ""},
+ {"", "scorebar", "|"},
+ {"", "{", "{"},
+ {"", "[", "["},
{0,0,0}
};
--- /dev/null
+/*
+ span-bar-grav.cc -- implement Base_span_bar_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#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<Bar *> (i.elem_l_))
+ {
+ bar_l_arr_.push (dynamic_cast<Bar *> (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<Vertical_align_spanner *> (i.elem_l_)
+ && i.origin_grav_l_arr_.size() <= 2)
+ {
+ valign_l_ = dynamic_cast<Vertical_align_spanner *> (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);
finished_grouping_p_ = 0;
grouping_p_ =0;
reqs_drul_[LEFT] = reqs_drul_[RIGHT] =0;
+ prev_start_req_ =0;
}
bool
{
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_;
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
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 ();
#include "abbreviation-beam.hh"
#include "misc.hh"
#include "debug.hh"
-#include "atom.hh"
+
#include "molecule.hh"
#include "leastsquares.hh"
#include "stem.hh"
*/
Real w = here->hpos_f () - prev->hpos_f ();
w = w/2 <? nw_f;
- Atom a;
+ Molecule a;
if (lhalfs) // generates warnings if not
a = lookup_l ()->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);
}
}
int rwholebeams = here->beams_i_drul_[RIGHT] <? next->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;
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;
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 <? nw_f;
for (; j < rwholebeams + rhalfs; j++)
{
- Atom b (a);
+ Molecule b (a);
b.translate_axis (-dir_ * dy * j, Y_AXIS);
- rightbeams.add_atom (b);
+ rightbeams.add_molecule (b);
}
}
Real thick = paper ()->get_var ("slur_thickness");
Array<Offset> c = get_controls ();
Real dy = c[3].y () - c[0].y ();
- Atom a;
+ Molecule a;
if (!dash_i_)
a = lookup_l ()->slur (c);
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;
{
}
+void
+Box::set_empty ()
+{
+ interval_a_[X_AXIS].set_empty ();
+ interval_a_[Y_AXIS].set_empty ();
+}
+
Box::Box (Interval ix, Interval iy)
{
x() = ix;
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<Spring_spacer*> ((*get_line_spacer) ());
sp->paper_l_ = pscore_l_->paper_l_;
sp->add_column (curline[0], true, line[LEFT]);
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<Score_column*>(curline[i]))->break_penalty_i () >= Break_req::FORCE))
return false;
}
return true;
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<Change_translator const*> (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;
+ 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);
}
/*
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<Change_translator const*> (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.
#include "molecule.hh"
#include "paper-def.hh"
#include "lookup.hh"
-#include "clef-engraver.hh"
#include "g-text-item.hh"
#include "p-score.hh"
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;
}
(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);
}
}
}
#include "debug.hh"
#include "score-column.hh"
-Crescendo::Crescendo()
+Crescendo::Crescendo ()
{
grow_dir_ =0;
dir_ = DOWN;
}
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;
if (w_dim < 0)
{
- warning (_ ("crescendo") + " " + _("too small"));
+ warning (_ ("crescendo") + " " + _ ("too small"));
w_dim = 0;
}
Drul_array<bool> 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<Score_column*>(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;
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;
}
{
init();
empty_b_ = d.empty_b_;
+ offset_ = d.offset_; //let's hope others will copy the refpoint appropriately.
}
Dimension_cache::Dimension_cache ()
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);
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";
Link_array<Translator_group> groups = group_l_arr ();
for (int i=0; i < groups.size(); i++)
{
- Engraver * eng = dynamic_cast<Engraver*> (groups[i]);
- if (eng)
+ Engraver_group_engraver * group = dynamic_cast<Engraver_group_engraver*> (groups[i]);
+ if (group)
{
- Engraver_group_engraver * group =
- (Engraver_group_engraver*) eng;
group->do_announces();
}
}
#include "engraver.hh"
#include "engraver-group.hh"
#include "debug.hh"
+#include "paper-def.hh"
void
Engraver::fill_staff_info (Staff_info&)
Paper_def*
Engraver::paper() const
{
- return (Paper_def*)output_def_l_;
+ return dynamic_cast<Paper_def*>(output_def_l_);
}
(c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "atom.hh"
+
#include "box.hh"
#include "debug.hh"
#include "lookup.hh"
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;
}
*/
#include "g-text-item.hh"
-#include "atom.hh"
+
#include "molecule.hh"
#include "paper-def.hh"
#include "lookup.hh"
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);
}
(c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-
+#include "molecule.hh"
#include "general-script-def.hh"
#include "debug.hh"
-#include "atom.hh"
+
Direction
General_script_def::staff_dir() 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;
-}
--- /dev/null
+/*
+ global-ctor.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+#include "global-ctor.hh"
+#include "array.hh"
+
+static Array<Global_ctor> *ctor_global_static_arr_p_;
+
+void
+add_constructor (Global_ctor c)
+{
+ if (!ctor_global_static_arr_p_)
+ ctor_global_static_arr_p_ = new Array<Global_ctor>;
+ 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)) ();
+}
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 ();
#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
--- /dev/null
+/*
+ base-span-bar-engraver.hh -- declare Span_bar_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#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*> 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
Beam *finished_beam_p_;
Beam *beam_p_;
-
+ Beam_req * prev_start_req_;
Rhythmic_grouping*grouping_p_;
Rhythmic_grouping*finished_grouping_p_;
void translate (Offset o);
/// smallest box enclosing #b#
+ void set_empty ();
void unite (Box b);
Box();
Box (Interval ix, Interval iy);
class Change_iterator : public Music_iterator
{
- Change_translator *change_l ();
void error (String);
protected:
#ifndef COLHPOS_HH
#define COLHPOS_HH
-#include "array.hh"
+#include "parray.hh"
#include "lily-proto.hh"
-typedef Array<Paper_column*> Line_of_cols;
+typedef Link_array<Paper_column> Line_of_cols;
struct Column_x_positions {
Line_spacer * spacer_l_;
--- /dev/null
+/*
+ cons.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "cons.hh"
--- /dev/null
+/*
+ cons.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef CONS_HH
+#define CONS_HH
+
+template<class T>
+class Cons
+{
+public:
+ T * car_;
+ Cons * next_;
+ virtual ~Cons ();
+ Cons () {
+ car_=0;
+ next_ =0;
+ }
+ Cons (T*t, Cons<T>*c)
+ {
+ car_ = t;
+ next_ = c;
+ }
+};
+
+template<class T>
+class Killing_cons : public Cons<T>
+{
+public:
+ Killing_cons (T *t, Cons<T> *p)
+ : Cons<T>( t,p)
+ {
+ }
+ virtual ~Killing_cons ();
+};
+
+#endif /* CONS_HH */
+
private:
- Atom get_symbol() const;
+ Molecule get_symbol() const;
};
#endif // CRESCENDO_HH
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;
--- /dev/null
+/*
+ global-ctor.hh -- declare Global construction stuff.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#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 */
+
#include <FlexLexer.h>
#include "string.hh"
-#include "array.hh"
+#include "parray.hh"
#include "fproto.hh"
#include "proto.hh"
protected:
bool close_input ();
- Array<Source_file*> include_stack_;
+ Link_array<Source_file> include_stack_;
Array<int> char_count_stack_;
public:
--- /dev/null
+/*
+ killing-cons.tcc -- declare Killing_cons
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef KILLING_CONS_TCC
+#define KILLING_CONS_TCC
+
+template<class T>
+Cons<T>::~Cons ()
+{
+}
+
+template<class T>
+Killing_cons<T>::~Killing_cons ()
+{
+ delete car_;
+ delete next_;
+}
+
+
+#endif /* KILLING_CONS_TCC */
+
class Line_of_score : public Spanner , public Super_element
{
public:
- Link_array<Paper_column> cols;
+ Link_array<Paper_column> cols_;
bool error_mark_b_;
#ifndef LOOKUP_HH
#define LOOKUP_HH
-#include "atom.hh"
#include "molecule.hh"
#include "fproto.hh"
-#include "scalar.hh"
#include "direction.hh"
#include "box.hh"
- 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<Offset> 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<Offset> 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<int>) const;
- Atom time_signature (Array<int>) const;
+ Molecule beam (Real, Real, Real) const;
+ Molecule clef (String) const;
+ Molecule dashed_slur (Array<Offset> 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<Offset> 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_;
virtual void do_process_requests();
private:
- Array<Lyric_req*> lreq_arr_;
+ Link_array<Lyric_req> lreq_arr_;
};
#endif // LYRIC_PERFOMER_HH
#ifndef STANDALONE
#include "lily-proto.hh"
-Interval itemlist_width (const Array<Item*> &its);
+Interval itemlist_width (const Link_array<Item> &its);
#endif
void set_frobnify (void*, size_t);
#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<Atom*> atoms_; // change to List<Atom>?
+class Molecule {
+ // Protected_scm atom_list_; // change to List<Atom>?
+ Killing_cons<Atom> *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
virtual bool ok () const;
protected:
- Music_wrapper *music_wrapper_l () const;
virtual void do_print () const;
virtual void do_process_and_next (Moment) ;
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();
Notename_table *chordmodifier_tab_p_;
Notename_table *note_tab_p_;
- Array<Scope*> scope_l_arr_;
+ Link_array<Scope> scope_l_arr_;
Keyword_table * keytable_p_;
int errorlevel_i_;
#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"
bool first_b_;
- Array<Request*> pre_reqs, post_reqs;
+ Link_array<Request> pre_reqs, post_reqs;
int fatal_error_i_;
Sources * source_l_;
int error_level_i_;
void do_yyparse();
void parser_error (String);
- Array<Request*>* get_parens_request (int t);
+ Link_array<Request>* get_parens_request (int t);
void set_debug();
void set_yydebug (bool);
void stop_line ();
void switch_to_font (String fontname);
- Array<String> font_arr_;
- String current_font_;
Paper_stream* outstream_l_;
};
+++ /dev/null
-/*
- piano-brace.hh -- declare Piano_brace
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#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 */
-
Protected_scm (Protected_scm const &);
~Protected_scm ();
Protected_scm &operator = (Protected_scm const &);
- operator SCM ();
+ operator SCM () const;
SCM to_SCM () const;
};
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 ();
#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<Rhythmic_grouping*> children;
+ Link_array<Rhythmic_grouping> children;
MInterval *interval_;
Rhythmic_grouping (Rhythmic_grouping const&);
Rhythmic_grouping (MInterval, int n=1);
Rhythmic_grouping();
- Rhythmic_grouping (Array<Rhythmic_grouping*>);
+ Rhythmic_grouping (Link_array<Rhythmic_grouping>);
~Rhythmic_grouping();
void add_child (Moment start, Moment len);
+++ /dev/null
-/*
- score-bar.hh -- declare Score_bar
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#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 */
-
#include "scalar.hh"
#include "lily-proto.hh"
-#include "array.hh"
+#include "parray.hh"
/**
Data container for broadcasts
struct Score_element_info {
Score_element * elem_l_;
Music *req_l_;
- Array<Engraver*> origin_grav_l_arr_;
+ Link_array<Engraver> origin_grav_l_arr_;
Score_element_info (Score_element*, Music*);
Score_element_info();
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;
class Script_engraver : public Engraver {
- Array<Script *> script_p_arr_;
- Array<Script_req *> script_req_l_arr_;
+ Link_array<Script> script_p_arr_;
+ Link_array<Script_req> script_req_l_arr_;
public:
VIRTUAL_COPY_CONS(Translator);
virtual void do_substitute_dependency (Score_element*,Score_element*);
virtual void do_print() const;
virtual Interval symbol_height() const;
- virtual Interval symbol_width () const;
virtual void do_pre_processing();
virtual Interval do_width() const;
VIRTUAL_COPY_CONS(Score_element);
#include "engraver.hh"
class Slur_engraver :public Engraver {
- Array<Slur_req*> requests_arr_;
- Array<Slur_req*> new_slur_req_l_arr_;
- Array<Slur *> slur_l_stack_;
- Array<Slur*> end_slur_l_arr_;
+ Link_array<Slur_req> requests_arr_;
+ Link_array<Slur_req> new_slur_req_l_arr_;
+ Link_array<Slur> slur_l_stack_;
+ Link_array<Slur> end_slur_l_arr_;
protected:
virtual bool do_try_music (Music*);
+++ /dev/null
-/*
- span-bar-engraver.hh -- declare Span_bar_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#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 Span_bar_engraver : public Engraver
-{
- Span_bar * spanbar_p_;
- Array<Bar*> bar_l_arr_;
- Vertical_align_spanner * valign_l_;
-public:
- VIRTUAL_COPY_CONS(Translator);
-
-
- Span_bar_engraver();
-protected:
- virtual void do_creation_processing ();
- virtual void do_removal_processing ();
- 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
class Span_bar : public virtual Bar
{
- Link_array<Score_element> spanning_l_arr_;
-
+ Link_array<Score_element> spanning_l_arr_;
+ Interval get_spanned_interval () const;
public:
- Span_bar();
+ Real extra_x_off_;
+ bool no_width_b_;
+ Span_bar();
- VIRTUAL_COPY_CONS(Score_element);
- void add_bar (Bar*);
- void set_align (Align_element *);
+ VIRTUAL_COPY_CONS(Score_element);
+ void add_bar (Bar*);
+ void set_align (Align_element *);
protected:
- void evaluate_empty ();
- virtual Interval do_width() const;
- virtual void do_pre_processing();
- virtual void do_post_processing();
-
- virtual void do_substitute_dependency (Score_element*,Score_element*);
- virtual Molecule * do_brew_molecule_p() const;
- virtual Molecule get_bar_sym (Real dy) const;
+ void evaluate_empty ();
+ virtual Interval do_width() const;
+ virtual void do_pre_processing();
+ virtual void do_post_processing();
+ virtual Interval do_height () const;
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
+ virtual Molecule * do_brew_molecule_p() const;
};
#endif // SPAN_BAR_HH
#ifndef SPAN_SCORE_BAR_GRAV_HH
#define SPAN_SCORE_BAR_GRAV_HH
-#include "span-bar-engraver.hh"
+#include "base-span-bar-engraver.hh"
/**
*/
-class Span_score_bar_engraver : public Span_bar_engraver
+class Span_score_bar_engraver : public Base_span_bar_engraver
{
public:
VIRTUAL_COPY_CONS (Translator);
-
+ Span_score_bar_engraver ();
virtual Span_bar* get_span_bar_p () const;
};
+++ /dev/null
-
-/*
- staff-bracket.hh -- declare Staff_bracket
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef STAFF_BRACKET_HH
-#define STAFF_BRACKET_HH
-#include "span-score-bar.hh"
-class Staff_bracket : public Span_score_bar
-{
-public:
-
- VIRTUAL_COPY_CONS(Score_element);
-
-protected:
- virtual Interval do_width() const;
- virtual void do_post_processing();
- virtual Molecule get_bar_sym (Real) const;
-};
-
-
-#endif /* STAFF_BRACKET_HH */
-
protected:
virtual Interval symbol_height () const;
- virtual Interval symbol_width () const;
Interval symbol_extent () const;
virtual Real get_position_f () const;
virtual void do_substitute_dependency (Score_element *, Score_element*);
virtual void do_print() const;
virtual Direction staff_dir() const;
- virtual Atom get_atom (Paper_def* p, Direction dir_) const;
+ virtual Molecule get_molecule (Paper_def* p, Direction dir_) const;
virtual ~Text_def() {};
virtual bool do_equal_b (const General_script_def*) const;
Text_def();
virtual void print() const;
- virtual Interval width (Paper_def*) const;
-private:
- Real guess_width_f(Atom&) const;
};
#endif // TEXT_DEF_HH
*/
-#ifndef METERGRAV_HH
-#define METERGRAV_HH
+#ifndef TIME_SIG_ENGRAVER_HH
+#define TIME_SIG_ENGRAVER_HH
#include "engraver.hh"
#include "time-description.hh"
#include "rhythmic-grouping.hh"
Time_signature_engraver();
};
-#endif // METERGRAV_HH
+#endif // TIME_SIG_ENGRAVER_HH
#ifndef TRANSLATOR_HH
#define TRANSLATOR_HH
-
+#include "global-ctor.hh"
#include "string.hh"
#include "lily-proto.hh"
#include "virtual-methods.hh"
};
-template<class T>
-class Translator_adder
-{
-public:
- static Translator *ctor ()
- {
- T *t = new T;
- t->type_str_ = classname (t);
- return t;
- }
- Translator_adder () {
- add_constructor (ctor);
- }
-};
-
/**
A macro to automate administration of translators.
*/
-#define ADD_THIS_TRANSLATOR(c) \
- Translator_adder<c> _ ## c ## init;
+#define ADD_THIS_TRANSLATOR(T) \
+static void _ ## T ## _adder () {\
+ T *t = new T;\
+ t->type_str_ = classname (t);\
+ add_translator (t);\
+}\
+ADD_GLOBAL_CTOR(_ ## T ## _adder);
+
-typedef Translator *(*Translator_ctor) ();
extern Dictionary<Translator*> *global_translator_dict_p;
void add_translator (Translator*trans_p);
-void add_constructor (Translator_ctor ctor);
Translator*get_translator_l (String s);
Item::find_prebroken_piece (Line_of_score*l) const
{
if (line_l() == l)
- return (Item*)this;
+ return (Item*)(this);
else if (broken_to_drul_[LEFT] && broken_to_drul_[LEFT]->line_l() == l)
return broken_to_drul_[LEFT];
else if (broken_to_drul_[RIGHT] && broken_to_drul_[RIGHT]->line_l() == l)
Item::find_prebroken_piece (Direction breakstatus) const
{
if (!breakstatus)
- return (Item *) this; // ugh
+ return (Item *)(this); // ugh
else
- return (Item*) broken_to_drul_[breakstatus];
+ return dynamic_cast<Item*>( broken_to_drul_[breakstatus]);
}
void
#include "line-of-score.hh"
#include "spanner.hh"
-#include "atom.hh"
+
#include "paper-def.hh"
#include "p-col.hh"
#include "p-score.hh"
bool
Line_of_score::contains_b (Paper_column const* c) const
{
- return cols.find_l ((Paper_column*)c);
+ return cols_.find_l ((Paper_column*)(c));
}
Line_of_score*
Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
{
- const Array<Paper_column*> &curline (breaking[j].cols);
- const Array<Paper_column*> &errors (breaking[j].error_col_l_arr_);
+ const Link_array<Paper_column> &curline (breaking[j].cols);
+ const Link_array<Paper_column> &errors (breaking[j].error_col_l_arr_);
const Array<Real> &config (breaking[j].config);
for (int i=0; i < errors.size(); i++)
line_l = dynamic_cast <Line_of_score*> (clone());
}
else
- line_l = (Line_of_score*) this;
-
- ((Array<Paper_column*> &)line_l->cols) = curline;
+ line_l = (Line_of_score*)( this);
+
+ line_l->cols_ = curline;
+ /* Array<Paper_column*> &
+ ((Array<Paper_column*> &)) = */
line_l->set_bounds(LEFT,curline[0]);
line_l->set_bounds(RIGHT,curline.top());
for (int i=0; i < curline.size(); i++)
{
curline[i]->translate_axis (config[i],X_AXIS);
- curline[i]->line_l_ = (Line_of_score*)line_l;
+ curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
}
return line_l;
Line_of_score::get_extra_dependencies () const
{
Link_array<Score_element> r;
- for (int i=0; i < cols.size (); i++)
- r.push (cols[i]);
+ for (int i=0; i < cols_.size (); i++)
+ r.push (cols_[i]);
return r;
}
Line_of_score::do_unlink ()
{
Spanner::do_unlink ();
- for (int i=0; i < cols.size (); i++)
- cols[i]->line_l_ =0;
- cols.set_size (0);
+ for (int i=0; i < cols_.size (); i++)
+ cols_[i]->line_l_ =0;
+ cols_.set_size (0);
}
void
Line_of_score::do_junk_links ()
{
- cols.set_size (0);
+ cols_.set_size (0);
}
#include "afm.hh"
#include "scope.hh"
#include "molecule.hh"
+#include "atom.hh"
SCM
array_to_list (SCM *a , int l)
}
+Molecule
+Lookup::ledger_line (Interval xwid) const
+{
+ Molecule end (afm_find ("noteheads-ledgerending"));
+ Interval ed = end.dim_[X_AXIS];
+ xwid = Interval (xwid[LEFT] - ed[LEFT],
+ xwid[RIGHT] - ed[RIGHT]);
+ Molecule mid = filledbox (Box (xwid, end.dim_[Y_AXIS]));
+ Molecule l (mid);
+
+ Molecule e2 = end;
+ Molecule e1 = end;
+ e1.translate_axis (xwid[RIGHT], X_AXIS);
+ e2.translate_axis (xwid[LEFT], X_AXIS);
+
+ l.add_molecule (e1);
+ l.add_molecule (e2);
+ return l;
+}
+
Molecule
Lookup::accidental (int j, bool cautionary) const
{
- Molecule m(afm_find (String ("accidentals") + String ("-") + to_str (j)));
+ Molecule m(afm_find (String ("accidentals-") + to_str (j)));
if (cautionary)
{
- Atom open = afm_find (String ("accidentals") + String ("-("));
- Atom close = afm_find (String ("accidentals") + String ("-)"));
+ Molecule open = afm_find (String ("accidentals-("));
+ Molecule close = afm_find (String ("accidentals-)"));
m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0);
m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0);
}
-Atom
+Molecule
Lookup::afm_find (String s, bool warn) const
{
if (!afm_l_)
{
- Lookup * me = ((Lookup*)this);
+ Lookup * me = (Lookup*)(this);
me->afm_l_ = all_fonts_global_p->find_afm (font_name_);
if (!me->afm_l_)
{
warning (_f("Search path %s\n", global_path.str ().ch_C()));
}
}
- Adobe_font_char_metric m = afm_l_->find_char (s, warn);
-
- Atom a;
- if (m.code () < 0)
- return a;
+ Adobe_font_char_metric cm = afm_l_->find_char (s, warn);
+ Molecule m;
+ if (cm.code () < 0)
+ return m;
- a.dim_ = m.dimensions();
-
- a.lambda_ = gh_list (ly_symbol ("char"),
- gh_int2scm (m.code ()),
- SCM_UNDEFINED);
- a.font_ = font_name_;
- return a;
+ Atom at (gh_list (ly_symbol ("char"),
+ gh_int2scm (cm.code ()),
+ SCM_UNDEFINED));
+ at.font_ = ly_symbol (font_name_.ch_C());
+ m.dim_ = cm.dimensions();
+ m.add_atom (&at);
+ return m;
}
-Atom
+Molecule
Lookup::ball (int j) const
{
if (j > 2)
j = 2;
- return afm_find (String ("balls") + String ("-") + to_str (j));
+ return afm_find (String ("noteheads-") + to_str (j));
}
-Atom
+Molecule
Lookup::simple_bar (String type, Real h) const
{
SCM thick = ly_symbol ("barthick_" + type);
{
w = paper_l_->get_realvar (thick);
}
-
- Atom a;
- a.lambda_ = gh_list (ly_symbol ("filledbox"),
- gh_double2scm (0),
- gh_double2scm (w),
- gh_double2scm (h/2),
- gh_double2scm (h/2),
- SCM_UNDEFINED);
-
- a.dim_[X_AXIS] = Interval(0,w);
- a.dim_[Y_AXIS] = Interval (-h/2, h/2);
- return a;
+
+ return filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
}
Molecule
Lookup::bar (String str, Real h) const
{
+ if (str == "[")
+ return staff_bracket (h);
+ else if (str == "{")
+ return staff_brace (h);
+
Real kern = paper_l_->get_var ("bar_kern");
Real thinkern = paper_l_->get_var ("bar_thinkern");
- Atom thin = simple_bar ("thin", h);
- Atom thick = simple_bar ("thick", h);
- Atom colon = afm_find ("dots-repeatcolon");
+ Molecule thin = simple_bar ("thin", h);
+ Molecule thick = simple_bar ("thick", h);
+ Molecule colon = afm_find ("dots-repeatcolon");
Molecule m;
-
+
if (str == "")
{
- return fill (Box (Interval(0,0),Interval (-h/2, h/2)));
+ return fill (Box (Interval(0, 0), Interval (-h/2, h/2)));
}
else if (str == "|")
{
else if (str == "|.")
{
m.add_at_edge (X_AXIS, LEFT, thick, 0);
- m.add_at_edge (X_AXIS, LEFT, thin,kern);
+ m.add_at_edge (X_AXIS, LEFT, thin, kern);
}
else if (str == ".|")
{
}
else if (str == "|:")
{
- m.add_at_edge (X_AXIS, RIGHT, thick,0);
- m.add_at_edge (X_AXIS, RIGHT, thin,kern);
- m.add_at_edge (X_AXIS, RIGHT, colon,kern);
+ m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+ m.add_at_edge (X_AXIS, RIGHT, colon, kern);
}
else if (str == ":|:")
{
- m.add_at_edge (X_AXIS, LEFT, thick,thinkern);
- m.add_at_edge (X_AXIS, LEFT, colon,kern);
- m.add_at_edge (X_AXIS, RIGHT, thick,kern);
- m.add_at_edge (X_AXIS, RIGHT, colon,kern);
- }
- else if (str == "||")
- {
- m.add_at_edge (X_AXIS, RIGHT, thin,0);
- m.add_at_edge (X_AXIS, RIGHT, thin,thinkern);
+ m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+ m.add_at_edge (X_AXIS, LEFT, colon, kern);
+ m.add_at_edge (X_AXIS, RIGHT, thick, kern);
+ m.add_at_edge (X_AXIS, RIGHT, colon, kern);
}
-
else if (str == ".|.")
{
- m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+ m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
m.add_at_edge (X_AXIS, RIGHT, thick, kern);
}
+ else if (str == "||")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thin, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, thinkern);
+ }
return m;
}
-Atom
+Molecule
Lookup::beam (Real slope, Real width, Real thick) const
{
Real height = slope * width;
Real min_y = (0 <? height) - thick/2;
Real max_y = (0 >? height) + thick/2;
- Atom a;
- a.lambda_ = gh_list (ly_symbol ("beam"),
- gh_double2scm (width),
- gh_double2scm (slope),
- gh_double2scm (thick),
- SCM_UNDEFINED);
-
- a.dim_[X_AXIS] = Interval (0, width);
- a.dim_[Y_AXIS] = Interval (min_y, max_y);
- return a;
+
+ Molecule m;
+ Atom at
+ (gh_list (ly_symbol ("beam"),
+ gh_double2scm (width),
+ gh_double2scm (slope),
+ gh_double2scm (thick),
+ SCM_UNDEFINED));
+
+ m.dim_[X_AXIS] = Interval (0, width);
+ m.dim_[Y_AXIS] = Interval (min_y, max_y);
+ m.add_atom (&at);
+ return m;
}
-Atom
+Molecule
Lookup::clef (String st) const
{
- return afm_find (String ("clefs") + String ("-") + st);
+ return afm_find (String ("clefs-" + st));
}
SCM
SCM_UNDEFINED);
}
-Atom
+Molecule
Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
{
assert (controls.size () == 8);
Real dx = d[X_AXIS];
Real dy = d[Y_AXIS];
- Atom a;
- a.font_ = font_name_;
- a.dim_[X_AXIS] = Interval (0, dx);
- a.dim_[Y_AXIS] = Interval (0 <? dy, 0 >? dy);
+ Molecule m;
+
+
+ m.dim_[X_AXIS] = Interval (0, dx);
+ m.dim_[Y_AXIS] = Interval (0 <? dy, 0 >? dy);
SCM sc[4];
for (int i=0; i< 4; i++)
sc[i] = offset2scm (controls[i]);
}
- a.lambda_ =
- gh_list (ly_symbol ("dashed-slur"),
- gh_double2scm (thick),
- gh_double2scm (dash),
- ly_quote_scm (array_to_list (sc, 4)),
- SCM_UNDEFINED);
-
- return a;
+ Atom at
+ (gh_list (ly_symbol ("dashed-slur"),
+ gh_double2scm (thick),
+ gh_double2scm (dash),
+ ly_quote_scm (array_to_list (sc, 4)),
+ SCM_UNDEFINED));
+
+
+ m.add_atom (&at);
+ return m;
}
-Atom
+Molecule
Lookup::dots () const
{
- return afm_find (String ("dots") + String ("-") + String ("dot"));
+ return afm_find (String ("dots-dot"));
}
-Atom
-Lookup::extender (Real width) const
-{
- Atom a;
- a.lambda_ = gh_list (ly_symbol ("extender"),
- gh_double2scm (width),
- SCM_UNDEFINED);
- a.dim_[X_AXIS] = Interval (0, width);
- a.dim_[Y_AXIS] = Interval (0,0);
-
- a.font_ = font_name_;
- return a;
-}
-
-Atom
+Molecule
Lookup::fill (Box b) const
{
- Atom a;
- a.dim_ = b;
- return a;
+ Molecule m;
+ m.dim_ = b;
+ return m;
}
-Atom
+Molecule
Lookup::flag (int j, Direction d) const
{
char c = (d == UP) ? 'u' : 'd';
- Atom a = afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j));
- return a;
+ return afm_find (String ("flags-") + to_str (c) + to_str (j));
}
-Atom
+Molecule
Lookup::rest (int j, bool o) const
{
- return afm_find (String ("rests")
- + String ("-") + to_str (j) + (o ? "o" : ""));
+ return afm_find (String ("rests-") + to_str (j) + (o ? "o" : ""));
}
-Atom
+Molecule
Lookup::rule_symbol (Real height, Real width) const
{
- Atom a;
- a.lambda_ = gh_list (ly_symbol ("rulesym"),
- gh_double2scm (height),
- gh_double2scm (width),
- SCM_UNDEFINED);
- a.dim_.x () = Interval (0, width);
- a.dim_.y () = Interval (0, height);
- return a;
+ Atom at (gh_list (ly_symbol ("rulesym"),
+ gh_double2scm (height),
+ gh_double2scm (width),
+ SCM_UNDEFINED));
+
+ Molecule m;
+ m.dim_.x () = Interval (0, width);
+ m.dim_.y () = Interval (0, height);
+
+ m.add_atom (&at);
+
+ return m;
}
-Atom
+Molecule
Lookup::script (String str) const
{
- return afm_find (String ("scripts") + String ("-") + str);
+ return afm_find (String ("scripts-") + str);
}
-Atom
-Lookup::special_time_signature (String s, Array<int> arr) const
+Molecule
+Lookup::special_time_signature (String s, int n, int d) const
{
// First guess: s contains only the signature style
- assert (arr.size () >1);
- String symbolname = "timesig-" + s + to_str (arr[0]) + "/" + to_str (arr[1]);
+ String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d);
- Atom a = afm_find (symbolname, false);
- if (!a.empty ())
- return a;
+ Molecule m = afm_find (symbolname, false);
+ if (!m.dim_[X_AXIS].empty_b ())
+ return m;
// Second guess: s contains the full signature name
- a = afm_find ("timesig-"+s, false);
- if (!a.empty ())
- return a;
+ m = afm_find ("timesig-"+s, false);
+ if (!m.dim_[X_AXIS].empty_b ())
+ return m;
// Resort to default layout with numbers
- return time_signature (arr);
+ return time_signature (n,d);
}
-Atom
+Molecule
+Lookup::filledbox (Box b ) const
+{
+ Molecule m;
+
+ Atom at (gh_list (ly_symbol ("filledbox"),
+ gh_double2scm (-b[X_AXIS][LEFT]),
+ gh_double2scm (b[X_AXIS][RIGHT]),
+ gh_double2scm (-b[Y_AXIS][DOWN]),
+ gh_double2scm (b[Y_AXIS][UP]),
+ SCM_UNDEFINED));
+
+ m.dim_ = b;
+ m.add_atom (&at);
+ return m;
+}
+
+Molecule
Lookup::stem (Real y1, Real y2) const
{
if (y1 > y2)
y1 = y2;
y2 = t;
}
- Atom a;
-
- a.dim_.x () = Interval (0,0);
- a.dim_.y () = Interval (y1,y2);
-
Real stem_width = paper_l_->get_var ("stemthickness");
-
- a.lambda_ = gh_list (ly_symbol ("filledbox"),
- gh_double2scm(stem_width /2),
- gh_double2scm(stem_width/2),
- gh_double2scm(y2),
- gh_double2scm(-y1),
- SCM_UNDEFINED);
-
- a.font_ = font_name_;
- return a;
+ return filledbox (Box (Interval (-stem_width/2,stem_width/2),
+ Interval (y1, y2)));
}
-Atom
-Lookup::streepje (int type) const
-{
- if (type > 2)
- type = 2;
-
- return afm_find ("balls" + String ("-") +to_str (type) + "l");
-}
static Dict_initialiser<char const*> cmr_init[] = {
{"bold", "cmbx"},
{"large", "cmbx"},
{"Large", "cmbx"},
{"mark", "feta-nummer"},
- {"nummer", "feta-nummer"},
+ {"number", "feta-nummer"},
{0,0}
};
static Dictionary<char const *> cmr_dict (cmr_init);
-Atom
+Molecule
Lookup::text (String style, String text) const
{
- Atom a;
- a.lambda_ = gh_list(ly_symbol ("set" + style),
- gh_str02scm (text.ch_C()),
- SCM_UNDEFINED);
+ Molecule m;
+
Real font_h = paper_l_->get_var ("font_normal");
if (paper_l_->scope_p_->elem_b ("font_" + style))
{
font_h = paper_l_->get_var ("font_" + style);
}
-
+
if (cmr_dict.elem_b (style))
{
style = String (cmr_dict [style]) + to_str ((int)font_h); // ugh
}
DOUT << "\n" << to_str (w) << "\n";
- a.dim_.x () = Interval (0, w);
- a.dim_.y () = ydims;
- a.font_ = font_name_;
- return a;
+ m.dim_.x () = Interval (0, w);
+ m.dim_.y () = ydims;
+ Atom at (gh_list (ly_symbol ("text"),
+ gh_str02scm (text.ch_C()),
+ SCM_UNDEFINED));
+ at.font_ = ly_symbol (style);
+
+ m.add_atom (&at);
+ return m;
}
/*
- TODO: should return a molecule with 2 stacked nums.
*/
-Atom
-Lookup::time_signature (Array<int> a) const
+Molecule
+Lookup::time_signature (int num, int den) const
{
- Atom s;
- s.lambda_ = gh_list (ly_symbol ("generalmeter"),
- gh_int2scm (a[0]),
- gh_int2scm (a[1]),
- SCM_UNDEFINED);
-
- Real r = paper_l_->interline_f () ;
- s.dim_[Y_AXIS] = Interval (-2*r, 2*r);
- s.dim_[X_AXIS] = Interval (0, 2*r);
- return s;
+ String sty = "number";
+ Molecule n (text (sty, to_str (num)));
+ Molecule d (text (sty, to_str (den)));
+ n.do_center (X_AXIS);
+ d.do_center (X_AXIS);
+ Molecule m;
+ if (den)
+ {
+ m.add_at_edge (Y_AXIS, UP, n, 0.0);
+ m.add_at_edge (Y_AXIS, DOWN, d, 0.0);
+ }
+ else
+ {
+ m = n;
+ m.do_center (Y_AXIS);
+ }
+ return m;
}
-Atom
-Lookup::vbrace (Real &y) const
+Molecule
+Lookup::staff_brace (Real y) const
{
- Atom a;
- a.lambda_ = gh_list (ly_symbol ("pianobrace"),
+ Molecule m;
+
+ Atom at (gh_list (ly_symbol ("pianobrace"),
gh_double2scm (y),
SCM_UNDEFINED
- );
- a.dim_[Y_AXIS] = Interval (-y/2,y/2);
- a.dim_[X_AXIS] = Interval (0,0);
- a.font_ = font_name_;
- return a;
+ ));
+
+ m.dim_[Y_AXIS] = Interval (-y/2,y/2);
+ m.dim_[X_AXIS] = Interval (0,0);
+ m.add_atom (&at);
+ return m;
}
-Atom
+Molecule
Lookup::hairpin (Real width, bool decresc, bool continued) const
{
- Atom a;
+ Molecule m;
Real height = paper_l_->staffheight_f () / 6;
String hairpin = String (decresc ? "de" : "") + "crescendo";
- a.lambda_ = gh_list (ly_symbol (hairpin),
+ Atom at (gh_list (ly_symbol (hairpin),
gh_double2scm (width),
gh_double2scm (height),
gh_double2scm (continued ? height/2 : 0.0),
- SCM_UNDEFINED);
- a.dim_.x () = Interval (0, width);
- a.dim_.y () = Interval (-2*height, 2*height);
- a.font_ = font_name_;
- return a;
+ SCM_UNDEFINED));
+ m.dim_.x () = Interval (0, width);
+ m.dim_.y () = Interval (-2*height, 2*height);
+
+ m.add_atom (&at);
+ return m;
}
-Atom
+Molecule
Lookup::plet (Real dy , Real dx, Direction dir) const
{
- Atom a;
+ Molecule m;
SCM thick = ly_symbol ("tuplet_thick");
Real t = 0.1 PT;
if (paper_l_->scope_p_->elem_b (thick))
{
t = paper_l_->get_realvar (thick);
}
- a.lambda_ = gh_list(ly_symbol ("tuplet"),
+
+ Atom at (gh_list(ly_symbol ("tuplet"),
gh_double2scm (dx),
gh_double2scm (dy),
gh_double2scm (t),
gh_int2scm (dir),
- SCM_UNDEFINED);
- return a;
-}
+ SCM_UNDEFINED));
+m.add_atom (&at);
+ return m;
+}
-Atom
+/*
+ Make a smooth curve along the points
+ */
+Molecule
Lookup::slur (Array<Offset> controls) const
{
- assert (controls.size () == 8);
- Real dx = controls[3].x () - controls[0].x ();
- Real dy = controls[3].y () - controls[0].y ();
- Atom a;
+ Offset delta_off = controls[3]- controls[0];
+ Molecule m;
SCM scontrols [8];
int indices[] = {5,6,7,4,1,2,3,0};
scontrols[i] = offset2scm (controls[indices[i]]);
- a.lambda_ =gh_list (ly_symbol ("slur"),
+ Atom at (gh_list (ly_symbol ("bezier-sandwich"),
ly_quote_scm (array_to_list (scontrols, 8)),
- SCM_UNDEFINED);
+ SCM_UNDEFINED));
- a.dim_[X_AXIS] = Interval (0, dx);
- a.dim_[Y_AXIS] = Interval (0 <? dy, 0 >? dy);
- a.font_ = font_name_;
- return a;
+ m.dim_[X_AXIS] = Interval (0, delta_off[X_AXIS]);
+ m.dim_[Y_AXIS] = Interval (0 <? delta_off[Y_AXIS], 0 >? delta_off[Y_AXIS]);
+ m.add_atom (&at);
+ return m;
}
-Atom
-Lookup::vbracket (Real &y) const
+Molecule
+Lookup::staff_bracket (Real y) const
{
- Atom a;
- a.lambda_ = gh_list (ly_symbol ("bracket"),
+ Molecule m;
+ Atom at ( gh_list (ly_symbol ("bracket"),
gh_double2scm (y),
- SCM_UNDEFINED);
- a.dim_[Y_AXIS] = Interval (-y/2,y/2);
- a.dim_[X_AXIS] = Interval (0,4 PT);
- return a;
+ SCM_UNDEFINED));
+ m.add_atom (&at);
+ m.dim_[Y_AXIS] = Interval (-y/2,y/2);
+ m.dim_[X_AXIS] = Interval (0,4 PT);
+
+ m.translate_axis (- 4. / 3. * m.dim_[X_AXIS].length (), X_AXIS);
+ return m;
}
-Atom
+Molecule
Lookup::volta (Real w, bool last_b) const
{
- Atom a;
+ Molecule m;
SCM thick = ly_symbol ("volta_thick");
Real t = 0.1 PT;
if (paper_l_->scope_p_->elem_b (thick))
{
t = paper_l_->get_realvar (thick);
}
- a.lambda_ = gh_list (ly_symbol ("volta"),
+ Atom at (gh_list (ly_symbol ("volta"),
gh_double2scm (w),
gh_double2scm (t),
gh_int2scm (last_b),
- SCM_UNDEFINED);
+ SCM_UNDEFINED));
Real interline_f = paper_l_->interline_f ();
- a.dim_[Y_AXIS] = Interval (-interline_f, interline_f);
- a.dim_[X_AXIS] = Interval (0, w);
- return a;
+ m.dim_[Y_AXIS] = Interval (-interline_f, interline_f);
+ m.dim_[X_AXIS] = Interval (0, w);
+
+ m.add_atom (&at);
+ return m;
}
-Atom
+Molecule
Lookup::special_ball (int j, String kind_of_ball) const
{
if (j > 2)
j = 2;
- return afm_find (String ("balls") + String ("-") + kind_of_ball);
+ return afm_find (String ("noteheads-") + kind_of_ball);
}
+
#include "lily-guile.hh"
#include "paper-def.hh"
#include "midi-def.hh"
+#include "global-ctor.hh"
#if HAVE_GETTEXT
#include <libintl.h>
void
main_prog (int argc, char **argv)
{
+ /*
+ need to do this first. Engravers use lily.scm contents.
+ */
+ read_lily_scm_file ( "lily.scm");
+ cout << endl;
+
call_constructors ();
default_outname_base_global = "lelie";
all_fonts_global_p = new All_font_metrics (global_path.str ());
Midi_note::pitch_i () const
{
int p = dynamic_cast <Melodic_req*> (audio_item_l_->req_l_)->pitch_.semitone_pitch ()
- + ((Audio_note*)audio_item_l_)->transposing_i_;
+ + dynamic_cast<Audio_note*>(audio_item_l_)->transposing_i_;
if (p == INT_MAX)
{
warning (_ ("silly pitch"));
Midi_note_off::pitch_i () const
{
return dynamic_cast <Melodic_req *> (audio_item_l_->req_l_)->pitch_.semitone_pitch ()
- + ((Audio_note*)audio_item_l_)->transposing_i_;
+ + dynamic_cast<Audio_note*>(audio_item_l_)->transposing_i_;
}
String
Midi_tempo::Midi_tempo (Audio_item* audio_item_l)
: Midi_item (audio_item_l)
{
- per_minute_4_i_ = ( (Audio_tempo*)audio_item_l_)->per_minute_4_i_;
+ per_minute_4_i_ = dynamic_cast<Audio_tempo*>(audio_item_l_)->per_minute_4_i_;
}
Midi_tempo::Midi_tempo (int per_minute_4_i)
Midi_text::Midi_text (Audio_item* audio_item_l)
: Midi_item (audio_item_l)
{
- text_str_ = ( (Audio_text*)audio_item_l_)->text_str_;
- type_ = (Type) ( (Audio_text*)audio_item_l_)->type_;
+ text_str_ = dynamic_cast<Audio_text*>(audio_item_l_)->text_str_;
+ type_ = (Type) dynamic_cast<Audio_text*>(audio_item_l_)->type_;
}
Midi_text::Midi_text (Midi_text::Type type, String text_str)
#include "molecule.hh"
#include "atom.hh"
#include "debug.hh"
+#include "killing-cons.tcc"
Box
Molecule::extent() const
{
- Box b;
- for (iter_top (atoms_,c); c.ok(); c++)
- b.unite (c->extent());
- return b;
+ return dim_;
}
Interval
Molecule::extent(Axis a) const
{
- Interval i;
- for (iter_top (atoms_,c); c.ok(); c++)
- i.unite (c->extent(a));
- return i;
+ return dim_[a];
}
void
Molecule::translate (Offset o)
{
- for (iter_top (atoms_,c); c.ok(); c++)
- c->translate (o);
+ for (Cons<Atom> * ptr = atom_list_; ptr; ptr = ptr->next_)
+ {
+ ptr->car_->off_ += o;
+ }
+ dim_.translate (o);
}
void
Molecule::translate_axis (Real x,Axis a)
{
- for (iter_top (atoms_,c); c.ok(); c++)
- c->translate_axis (x,a);
+ for (Cons<Atom> * ptr = atom_list_; ptr; ptr = ptr->next_)
+ {
+ ptr->car_->off_[a] += x;
+ }
+ dim_[a] += x;
}
void
Molecule::add_molecule (Molecule const &m)
{
- for (iter_top (m.atoms_,c); c.ok(); c++)
+ for (Cons<Atom> * ptr = m.atom_list_; ptr; ptr = ptr->next_)
{
- add_atom (**c);
+ add_atom (ptr->car_);
}
-}
+ dim_.unite (m.dim_);
+}
void
-Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding)
+Molecule::add_atom (Atom const *al)
{
- Real my_extent= atoms_.size()
- ? extent ()[a][d]
- : 0.0;
-
- Real offset = my_extent - m.extent ()[a][-d];
- Molecule toadd (m);
- toadd.translate_axis (offset + d * padding, a);
- add_molecule (toadd);
+ Atom *a = new Atom(*al);
+
+ atom_list_ = new Killing_cons<Atom> (a, atom_list_);
}
-
-
void
-Molecule::operator = (Molecule const &)
+Molecule::operator=(Molecule const & src)
{
- assert (false);
+ if (&src == this) return;
+ delete atom_list_;
+ atom_list_ = 0;
+ dim_= src.dim_;
+ add_molecule (src);
}
Molecule::Molecule (Molecule const &s)
{
+ atom_list_ = 0;
add_molecule (s);
}
+Molecule::~Molecule ()
+{
+ delete atom_list_;
+}
+
void
Molecule::print() const
{
#ifndef NPRINT
if (! check_debug)
return;
- for (iter_top (atoms_,c); c.ok(); c++)
- c->print();
+ DOUT << "dim:";
+ for (Axis i=X_AXIS; i < NO_AXES; incr (i))
+ DOUT << axis_name_str (i) << " = " << dim_[i].str ();
#endif
}
void
-Molecule::add_atom (Atom const &a)
+Molecule::do_center (Axis a)
{
- atoms_.bottom().add (new Atom (a));
+ Interval i (extent (a));
+ translate_axis (-i.center (), a);
}
-Molecule::Molecule (Atom const &a)
+Molecule::Molecule ()
+{
+ dim_ = Box (Interval(0,0),Interval( 0,0 ));
+ atom_list_ = 0;
+}
+
+
+void
+Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding)
{
- add_atom (a) ;
+ Real my_extent= dim_[a][d];
+
+ Real offset = my_extent - m.extent ()[a][-d];
+ Molecule toadd (m);
+ toadd.translate_axis (offset + d * padding, a);
+ add_molecule (toadd);
}
if (!column_arr_.size ())
return mol_p;
- Atom s;
+ Molecule s;
if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
{
s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
{
s = (lookup_l ()->rest (-4, 0));
}
- mol_p->add_atom (s);
+ mol_p->add_molecule (s);
Real interline_f = paper ()->interline_f ();
if (measures_i_ == 1)
{
text.text_str_ = to_str (measures_i_);
text.style_str_ = "number";
text.align_dir_ = CENTER;
- Atom s = text.get_atom (paper (), UP);
+ Molecule s = text.get_molecule (paper (), UP);
s.translate_axis (3.0 * interline_f, Y_AXIS);
- mol_p->add_atom (s);
+ mol_p->add_molecule (s);
}
return mol_p;
void
Music_wrapper_iterator::construct_children ()
{
- child_iter_p_ = get_iterator_p (music_wrapper_l ()->element_l ());
+ child_iter_p_ =
+ get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l_)->element_l ());
}
Music_wrapper_iterator::~Music_wrapper_iterator ()
delete child_iter_p_;
}
-Music_wrapper*
-Music_wrapper_iterator::music_wrapper_l () const
-{
- return (Music_wrapper*) music_l_;
-}
bool
Music_wrapper_iterator::ok () const
Absolute_dynamic_req::do_print () const
{
#ifndef NPRINT
- Dynamic_req::do_print ();
- DOUT << " loudness " <<loudness_str ();
+ DOUT << " loudness " <<loudness_str_ ;
#endif
}
Absolute_dynamic_req::do_equal_b (Request *r) const
{
Absolute_dynamic_req *a = dynamic_cast <Absolute_dynamic_req *> (r);
- return a&& loudness_ == a->loudness_;
+ return a&& loudness_str_ == a->loudness_str_;
}
-String
-Dynamic_req::loudness_static_str (Loudness l)
-{
- switch (l)
- {
- case FFFFFF: return "ffffff";
- case FFFFF : return "fffff";
- case FFFF: return "ffff";
- case FFF: return "fff";
- case FF: return "ff";
- case F: return "f";
- case MF: return "mf";
- case MP: return "mp";
- case P: return "p";
- case PP: return "pp";
- case PPP: return "ppp";
- case PPPP: return "pppp";
- case PPPPP: return "ppppp";
- case PPPPPP: return "pppppp";
-
- case FP: return "fp";
- case SF: return "sf";
- case SFF: return "sff";
- case SFZ: return "sfz";
- case SP: return "sp";
- case SPP: return "spp";
- case RFZ: return "rfz";
- }
- return "";
-}
-
-String
-Absolute_dynamic_req::loudness_str () const
-{
- String str = loudness_static_str (loudness_);
- if (str.empty_b ())
- {
- String s = "mf";
- warning (_f ("never heard of dynamic scale `\%s\', assuming %s",
- str, s));
- str = s;
- }
- return str;
-}
-
-
Absolute_dynamic_req::Absolute_dynamic_req ()
{
- loudness_ = MF;
+ loudness_str_ = "fm"; // yes, "illegal" on purpose.
}
/*
UGH.
*/
-Array<Request*>*
+Link_array<Request>*
My_lily_parser::get_parens_request (int t)
{
- Array<Request*>& reqs = *new Array<Request*>;
+ Link_array<Request>& reqs = *new Link_array<Request>;
switch (t)
{
case '~':
#include "rest.hh"
#include "debug.hh"
-
-
bool
Note_column::rest_b () const
{
return iv;
}
-/*
-Interval
-Note_column::do_width () const
-{
- if (head_l_arr_.size ())
- return head_l_arr_[0]->extent (X_AXIS);
- else
- return Interval (0,0);
-}
-*/
void
Note_column::do_pre_processing()
{
void
Note_column::add_head (Rhythmic_head *h)
{
- if (dynamic_cast<Rest *> (h))
+ if (Rest*r=dynamic_cast<Rest *> (h))
{
- rest_l_arr_.push ((Rest*)h);
- add_support (h);
+ rest_l_arr_.push (r);
+ add_support (r);
}
- if (dynamic_cast<Note_head *> (h))
+ if (Note_head *nh=dynamic_cast<Note_head *> (h))
{
- head_l_arr_.push ((Note_head*) h);
- add_support (h);
+ head_l_arr_.push (nh);
+ add_support (nh);
}
}
Interval
Note_head::do_width () const
{
- Atom a = lookup_l ()->ball (balltype_i_);
+ Molecule a = lookup_l ()->ball (balltype_i_);
Interval i = a.dim_[X_AXIS];
i+= x_dir_ * i.length ();
return i;
? 0
: (abs(position_i_) - staff_size_i_/2) /2;
- //Atom s = lookup_l()->ball (balltype_i_);
-
- Atom s; // = lookup_l()->ball (balltype_i_);
+ Molecule head;
if (note_head_type_str_.length_i ()) {
- if (note_head_type_str_ == "normal")
+ if (note_head_type_str_ == "normal") // UGH
note_head_type_str_ = "";
- s = lookup_l()->special_ball (balltype_i_, note_head_type_str_);
+ head = lookup_l()->special_ball (balltype_i_, note_head_type_str_);
}
else
- s = lookup_l()->ball (balltype_i_);
- out = new Molecule (Atom (s));
- out->translate_axis (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS);
+ head = lookup_l()->ball (balltype_i_);
+
+ out = new Molecule (Molecule (head));
+ out->translate_axis (x_dir_ * head.dim_[X_AXIS].length (), X_AXIS);
- //out = new Molecule (Atom (s));
- //out->translate_axis (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS);
if (streepjes_i)
{
- int dir = sign (position_i_);
- Atom streepje = lookup_l ()->streepje (balltype_i_);
+ Direction dir = sign (position_i_);
+ Interval hd = head.dim_[X_AXIS];
+ Real hw = hd.length ()/4;
+
+ Molecule ledger
+ = lookup_l ()->ledger_line (Interval (hd[LEFT] - hw,
+ hd[RIGHT] + hw));
- int parity = (position_i_ % 2) ? 1 : 0;
-
+ int parity = abs(position_i_) % 2;
for (int i=0; i < streepjes_i; i++)
{
- Atom s = streepje;
+ Molecule s (ledger);
s.translate_axis (-dir * inter_f * (i*2 + parity),
Y_AXIS);
- out->add_atom (s);
+ out->add_molecule (s);
}
}
Paper_column*
Paper_column::prebreak_l() const
{
- return (Paper_column*)broken_to_drul_[LEFT];
+ return dynamic_cast<Paper_column*>(broken_to_drul_[LEFT]);
}
Paper_column*
Paper_column::postbreak_l() const
{
- return(Paper_column*) broken_to_drul_[RIGHT];
+ return dynamic_cast<Paper_column*>( broken_to_drul_[RIGHT]);
}
bool
Paper_column::breakpoint_b() const
Paper_column*
Paper_column::column_l () const
{
- return (Paper_column*)this;
+ return (Paper_column*)(this);
}
}
-#if 0
-void
-Paper_score::set_breaking (Array<Column_x_positions> const &breaking)
-{
- for (iter (span_p_list_.top (),i); i.ok ();)
- {
- Spanner *span_p = i.remove_p ();
- if (span_p->broken_b ()
- || !((Score_element*)span_p)->line_l ())
- {
- span_p->unlink ();
- delete span_p;
- }
- else
- {
- typeset_broken_spanner (span_p);
- }
- }
- for (iter (elem_p_list_.top (),i); i.ok () ;)
- {
- Item *i_l =dynamic_cast <Item *> (i);
- if (i_l && !i_l->line_l ())
- {
- i_l->unlink ();
- Score_element * item_p= i.remove_p ();
- delete item_p;
- }
- else
- i++;
- }
-}
-#endif
Array<Column_x_positions>
#include "paper-outputter.hh"
#include "paper-stream.hh"
#include "molecule.hh"
-#include "atom.hh"
#include "array.hh"
#include "string-convert.hh"
#include "debug.hh"
#include "scope.hh"
#include "identifier.hh"
#include "lily-version.hh"
+#include "atom.hh"
Paper_outputter::Paper_outputter (Paper_stream *s)
{
void
Paper_outputter::output_header ()
{
-
+#if 0
+ int gobble = 10000;
+ {// alloc big chunk of memory.
+ SCM beg = SCM_EOL;
+ String bigstr = String_convert::char_str (' ', 50);
+ for (int i = gobble; i--; )
+ {
+ beg = gh_cons (gh_str02scm (bigstr.ch_C()), beg);
+ }
+ }
+#endif
+
if (safe_global_b)
{
ly_set_scm ("security-paranoia", SCM_BOOL_T);
if (check_debug)
*outstream_l_ << String ("\n%start: ") << nm << "\n";
- for (PCursor <Atom*> i (m->atoms_); i.ok (); i++)
+
+ if (check_debug)
{
- Offset a_off = i->offset ();
+ output_comment (nm);
+ }
+
+
+ for (Cons<Atom> *ptr = m->atom_list_; ptr; ptr = ptr->next_)
+ {
+ Atom * i = ptr->car_;
+ Offset a_off = i->off_;
a_off += o;
- if (!i->lambda_)
+ if (!i->func_)
continue;
- if (check_debug)
+ if (i->font_)
{
- output_comment (classname (i.ptr ()->origin_l_));
-
+ output_scheme (gh_list (ly_symbol ("select-font"),
+ gh_str02scm (symbol_to_string (i->font_).ch_C()),
+ SCM_UNDEFINED));
}
-
- switch_to_font (i->font_);
-
- SCM args_scm = gh_list (gh_double2scm (a_off.x ()),
- gh_double2scm (a_off.y ()),
- i->lambda_.to_SCM (),
- SCM_UNDEFINED);
-
-
- SCM box_scm = gh_cons (ly_symbol ("placebox"), args_scm);
+ SCM box_scm
+ = gh_list (ly_symbol ("placebox"),
+ gh_double2scm (a_off.x ()),
+ gh_double2scm (a_off.y ()),
+ i->func_.to_SCM(),
+ SCM_UNDEFINED);
+
output_scheme (box_scm);
}
}
void
Paper_outputter::output_scheme (SCM scm)
{
- String o = String ("\'") + output_global_ch;
-
if (String (output_global_ch) == "scm")
{
static SCM port = 0;
output_String_def ( "LilyIdString", id_str);
}
-void
-Paper_outputter::switch_to_font (String fontname)
-{
- if (fontname.length_i () && fontname != current_font_)
- {
- current_font_ = fontname;
- int i=0;
-
- for (; i< font_arr_.size (); i++)
- if (font_arr_[i] == fontname)
- break;
-
- if (i == font_arr_.size ())
- {
- font_arr_.push (fontname);
- output_font_def (i, fontname);
- }
- output_font_switch (i);
- }
- return;
-}
-
void
Paper_outputter::start_line ()
{
gh_define (k.ch_l (), gh_int2scm (v));
}
-void
-Paper_outputter::output_font_switch (int i)
-{
- SCM scm = gh_list (ly_symbol ("font-switch"),
- gh_int2scm (i),
- SCM_UNDEFINED);
- output_scheme (scm);
-}
void
Paper_outputter::stop_line ()
{
SCM scm = gh_list (ly_symbol ("stop-line"), SCM_UNDEFINED);
output_scheme (scm);
-
- current_font_ = "";
- font_arr_.clear ();
}
THIS->post_reqs.push ($2);
}
| post_requests close_request_parens {
- Array<Request*>& r = *THIS->get_parens_request ($2);
- for (int i = 0; i < r.size (); i++ )
- r[i]->set_spot (THIS->here_input ());
- THIS->post_reqs.concat (r);
- delete &r;
+ Link_array<Request> *r = THIS->get_parens_request ($2);
+ for (int i = 0; i < r->size (); i++ )
+ r->elem (i)->set_spot (THIS->here_input ());
+ THIS->post_reqs.concat (*r);
+ delete r;
}
;
};
dynamic_req:
- ABSDYNAMIC '{' unsigned '}' {
+ ABSDYNAMIC '{' STRING '}' {
Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
- ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
+ ad_p ->loudness_str_ = *$3;
+ delete $3;
$$ =ad_p;
}
| SPANDYNAMIC '{' int int '}' {
}
| pre_requests open_request_parens {
-
- Array<Request*>& r = *THIS->get_parens_request ($2);
- for (int i = 0; i < r.size (); i++ )
- r[i]->set_spot (THIS->here_input ());
- THIS->pre_reqs.concat (r);
- delete &r;
+ Link_array<Request>* r = THIS->get_parens_request ($2);
+ for (int i = 0; i < r->size (); i++ )
+ r->elem (i)->set_spot (THIS->here_input ());
+ THIS->pre_reqs.concat (*r);
+ delete r;
}
;
+++ /dev/null
-
-/*
- span-score-bar.cc -- implement Span_score_bar
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "piano-brace.hh"
-#include "atom.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "main.hh"
-
-Piano_brace::Piano_brace ()
-{
- extra_move_left_f_ = 0.0;
-}
-
-Molecule
-Piano_brace::get_bar_sym (Real dy) const
-{
- Atom a = lookup_l ()->vbrace (dy);
- a.translate_axis (-extra_move_left_f_, X_AXIS);
-
-
- return a;
-}
-
-Interval
-Piano_brace::do_width() const
-{
- return Interval (0,0);
-}
-
-void
-Piano_brace::do_post_processing ()
-{
- Span_score_bar::do_post_processing();
- Interval i = Span_score_bar::do_height ();
- Real staffheight_f = paper ()->staffheight_f ();
-
- // don't set braces that span only one staff
- if (i.length () <= 2.0 * staffheight_f)
- {
- set_empty (true);
- transparent_b_ = true;
- }
-}
-
-
-
-
Protected_scm::~Protected_scm ()
{
if (object_)
- scm_unprotect_object (object_);
+ {
+ scm_unprotect_object (object_);
+ object_ =0L; // be nice to conservative GC
+ }
}
-Protected_scm::operator SCM ()
+Protected_scm::operator SCM () const
{
return object_;
}
repeat_iter_p_ = 0;
alternative_iter_p_ = 0;
here_mom_ = 0;
-#if 0
- unfold_i_ = repeated_music_l ()->unfold_b_ ?
- repeated_music_l ()->repeats_i_ - 1 : 0;
-#endif
unfold_i_ = -1;
}
void
Repeated_music_iterator::construct_children ()
{
-#if 0
- unfold_i_ = repeated_music_l ()->unfold_b_ ?
- repeated_music_l ()->repeats_i_ - 1 : 0;
-#endif
- repeat_iter_p_ = get_iterator_p (repeated_music_l ()->repeat_p_);
+ repeat_iter_p_ = get_iterator_p (dynamic_cast<Repeated_music const*> (music_l_)->repeat_p_);
}
void
{
if (first_b_)
{
- bool success = report_to_l ()->try_music (repeated_music_l ());
+ bool success = report_to_l ()->try_music (dynamic_cast<Repeated_music const*> (music_l_));
if (!success)
music_l_->warning ( _("No one to print a volta bracket"));
}
Moment
Repeated_music_iterator::next_moment () const
{
+
if (repeat_iter_p_)
return repeat_iter_p_->next_moment () + here_mom_;
else if (alternative_iter_p_)
return alternative_iter_p_->next_moment () + here_mom_;
- // huh?
-// return repeated_music_l ()->repeat_p_->length_mom ()
-// * Moment (repeated_music_l ()->repeats_i_)
-// + repeated_music_l ()->alternative_p_->length_mom () + here_mom_;
- return repeated_music_l ()->alternative_p_->length_mom () + here_mom_;
+
+ Repeated_music const*r = dynamic_cast<Repeated_music const*>(music_l_);
+ return r->alternative_p_->length_mom () + here_mom_;
}
+/*
+ FIXME
+ */
bool
Repeated_music_iterator::ok () const
{
return ok ();
}
-Repeated_music*
-Repeated_music_iterator::repeated_music_l () const
-{
- return (Repeated_music*)Music_iterator::music_l_;
-}
void
Repeated_music_iterator::start_next_element ()
{
- if (repeat_iter_p_)
+ Repeated_music const*rep =dynamic_cast<Repeated_music const*> (music_l_);
+
+
+ if (repeat_iter_p_)
{
assert (!repeat_iter_p_->ok ());
assert (!alternative_iter_p_);
delete repeat_iter_p_;
repeat_iter_p_ = 0;
alternative_iter_p_ = dynamic_cast<Music_list_iterator*>
- (get_iterator_p ((Music*)repeated_music_l ()->alternative_p_));
- here_mom_ += repeated_music_l ()->repeat_p_->length_mom ();
+ (get_iterator_p ((Music*)rep->alternative_p_));
+ here_mom_ += rep->repeat_p_->length_mom ();
}
else if (alternative_iter_p_)
{
delete alternative_iter_p_;
alternative_iter_p_ = 0;
if (unfold_i_ < 0)
- unfold_i_ = repeated_music_l ()->unfold_b_ ?
- repeated_music_l ()->repeats_i_ - 1 : 0;
+ unfold_i_ = rep->unfold_b_ ?
+ rep->repeats_i_ - 1 : 0;
if (unfold_i_)
{
unfold_i_--;
- repeat_iter_p_ = get_iterator_p (repeated_music_l ()->repeat_p_);
+ repeat_iter_p_ = get_iterator_p (rep->repeat_p_);
// urg, assume same length alternatives for now...
-// here_mom_ += repeated_music_l ()->alternative_p_->music_p_list_p_->top ()->length_mom ();
+// here_mom_ += rep->alternative_p_->music_p_list_p_->top ()->length_mom ();
/*
URG
this is *wrong* but at least it doesn't dump core
how to intercept this...
*/
- here_mom_ += repeated_music_l ()->alternative_p_->length_mom ();
+ here_mom_ += rep->alternative_p_->length_mom ();
}
}
}
bool streepjes_b = abs(position_i_) > staff_size_i_ /2 &&
(balltype_i_ == 0 || balltype_i_ == 1);
- Atom s(lookup_l ()->rest (balltype_i_, streepjes_b));
- Molecule * m = new Molecule ( Atom (s));
+ Molecule s(lookup_l ()->rest (balltype_i_, streepjes_b));
+ Molecule * m = new Molecule ( Molecule (s));
m->translate_axis (position_i_ * paper ()->internote_f (), Y_AXIS);
return m;
}
Item * item = dynamic_cast <Item *> (i.elem_l_);
if (!item)
return;
- if (dynamic_cast<Script *> (item)
- && i.req_l_
- && dynamic_cast <Musical_req *> (i.req_l_))
+ if (Script *s=dynamic_cast<Script *> (item))
{
- script_l_arr_.push ((Script*)item);
+ if (i.req_l_ && dynamic_cast <Musical_req *> (i.req_l_))
+ {
+ script_l_arr_.push (s);
+ }
}
- else if (dynamic_cast<Stem *> (item))
+ else if (Stem*s=dynamic_cast<Stem *> (item))
{
- stem_l_ = (Stem*) item;
+ stem_l_ = s;
}
- else if (dynamic_cast<Rhythmic_head *> (item))
+ else if (Rhythmic_head*r=dynamic_cast<Rhythmic_head *> (item))
{
- rhead_l_arr_.push ((Rhythmic_head*)item);
+ rhead_l_arr_.push (r);
}
- else if (dynamic_cast<Dot_column *> (item))
+ else if (Dot_column*d =dynamic_cast<Dot_column *> (item))
{
- dotcol_l_ = (Dot_column*) item;
+ dotcol_l_ = d;
}
}
//check on splitpoints..
int j = 0, i = 0, starti = 0, startj = 0;
- Array<Rhythmic_grouping*> ch;
+ Link_array<Rhythmic_grouping> ch;
while (1)
{
if (i >= children.size() || j >= splitpoints.size ())
}
else
{
- Rhythmic_grouping *newchild=new Rhythmic_grouping (
- children.slice (starti, i+1));
+ Link_array<Rhythmic_grouping> slice = children.slice (starti, i+1);
+ Rhythmic_grouping *newchild=new Rhythmic_grouping (slice);
ch.push (newchild);
}
}
-Rhythmic_grouping::Rhythmic_grouping (Array<Rhythmic_grouping*> r)
+Rhythmic_grouping::Rhythmic_grouping (Link_array<Rhythmic_grouping> r)
:children (r)
{
interval_ =0;
assert (m.left >= interval().left);
while (m.right >interval().right)
{
- Array<Rhythmic_grouping*> a (children);
+ Link_array<Rhythmic_grouping> a (children);
for (int i=0; i < a.size(); i++)
{
a[i] =new Rhythmic_grouping (*children[i]);
Moment here =0;
assert (beat_i_arr.size() == elt_length_arr.size ());
- Array<Rhythmic_grouping*> children;
+ Link_array<Rhythmic_grouping> children;
for (int i=0; i < beat_i_arr.size(); i++)
{
Moment last = here;
+++ /dev/null
-/*
- score-bar.cc -- implement Score_bar
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "score-bar.hh"
-
-
-
-void
-Score_bar::do_pre_processing ()
-{
- type_str_ = "|";
- if (break_status_dir() != RIGHT)
- {
- set_empty (true);
- transparent_b_ = true;
- }
-}
Score_element*
Score_element::dependency (int i) const
{
- return (Score_element*) get_out_edge_arr ()[i];
+ return (Score_element*) (get_out_edge_arr ()[i]);
}
int
Score_element*
Score_element::dependent (int i) const
{
- return (Score_element*) get_in_edge_arr()[i];
+ return (Score_element *)( get_in_edge_arr()[i]);
}
int
delete output_p_;
output_p_ = do_brew_molecule_p ();
- for (PCursor<Atom*> i(output_p_->atoms_); i.ok(); i++)
- {
- i->origin_l_ = this;
- }
-
pscore_l_->outputter_l_->output_molecule (output_p_,
absolute_offset (),
classname(this));
Molecule*
Score_element::do_brew_molecule_p() const
{
- Atom a (lookup_l ()->fill (Box (Interval (0,0), Interval (0,0))));
+ Molecule a (lookup_l ()->fill (Box (Interval (0,0), Interval (0,0))));
return new Molecule (a);
}
assert (dynamic_cast<Paper_def *> (output_def_l_));
assert (!daddy_trans_l_);
pscore_p_ = new Paper_score;
- pscore_p_->paper_l_ = (Paper_def*)output_def_l_;
+ pscore_p_->paper_l_ = dynamic_cast<Paper_def*>(output_def_l_);
}
void
Score_performer::play (Audio_element * p)
{
- if (dynamic_cast<Audio_item *> (p))
+ if (Audio_item * i=dynamic_cast<Audio_item *> (p))
{
- audio_column_l_->add_audio_item ((Audio_item*)p);
+ audio_column_l_->add_audio_item (i);
}
- else if (dynamic_cast<Audio_staff *> (p))
+ else if (Audio_staff*s=dynamic_cast<Audio_staff *> (p))
{
- performance_p_->add_staff ((Audio_staff*)p);
+ performance_p_->add_staff (s);
}
performance_p_->add_element (p);
}
Translator_group::do_add_processing ();
assert (dynamic_cast<Midi_def *> (output_def_l_));
performance_p_ = new Performance;
- performance_p_->midi_l_ = (Midi_def*) output_def_l_;
+ performance_p_->midi_l_ = dynamic_cast<Midi_def*>(output_def_l_);
}
#include "debug.hh"
#include "script-def.hh"
-#include "atom.hh"
+
#include "paper-def.hh"
#include "lookup.hh"
return inside_staff_b_;
}
-Atom
-Script_def::get_atom (Paper_def *p , Direction d) const
+Molecule
+Script_def::get_molecule (Paper_def *p , Direction d) const
{
String preidx_str ="";
if (invertsym_b_)
if (!script_p->specs_p_->inside_b())
script_p->add_support (s_l);
- if (dynamic_cast<Text_def *> (script_p->specs_p_)) // UGH
+ if (Text_def*td_l = dynamic_cast<Text_def *> (script_p->specs_p_)) // UGH
{
- Text_def * td_l = (Text_def*)script_p->specs_p_;
if (!td_l->style_str_.length_i ())
{
Scalar style = get_property ("textstyle", 0);
Interval
Script::do_width () const
{
- return specs_p_->get_atom (paper (), dir_).extent ().x ();
+ return specs_p_->get_molecule (paper (), dir_).extent ().x ();
}
void
Interval
Script::symbol_height () const
{
- return specs_p_->get_atom (paper (), dir_).extent ().y ();
+ return specs_p_->get_molecule (paper (), dir_).extent ().y ();
}
-Interval
-Script::symbol_width () const
-{
- return specs_p_->width (paper ());
-}
Molecule*
Script::do_brew_molecule_p () const
{
Real dx =0.;
- Molecule*mol_p = new Molecule (specs_p_->get_atom (paper (), dir_));
+ Molecule*mol_p = new Molecule (specs_p_->get_molecule (paper (), dir_));
/*
ugh, staccato dots are not centred between stafflines (how?)?
*/
for (int i=0; i < spacing_unit_l_arr_.size () -1; i++)
{
+ Single_malt_grouping_item *l =spacing_unit_l_arr_[i];
+ Single_malt_grouping_item *lb
+ = dynamic_cast<Single_malt_grouping_item*>(l->find_prebroken_piece (RIGHT));
+ Single_malt_grouping_item *r = spacing_unit_l_arr_[i+1];
+ Single_malt_grouping_item *rb
+ = dynamic_cast<Single_malt_grouping_item*>(r->find_prebroken_piece (LEFT));
+
a.push (Rod (spacing_unit_l_arr_[i], spacing_unit_l_arr_[i+1]));
- bool lb =spacing_unit_l_arr_[i]->column_l ()->breakable_b_;
if (lb)
{
- Rod r((Single_malt_grouping_item*)
- spacing_unit_l_arr_[i]->find_prebroken_piece (RIGHT),
- spacing_unit_l_arr_[i+1]);
- r.distance_f_ += paper ()->interline_f () *1.5;
- a.push (r);
+ Rod rod(lb, r);
+ rod.distance_f_ += paper ()->interline_f () *1.5;
+ a.push (rod);
}
- bool rb=spacing_unit_l_arr_[i+1]->column_l ()->breakable_b_;
+
if (rb)
{
- a.push (Rod (spacing_unit_l_arr_[i],
- (Single_malt_grouping_item*)
- spacing_unit_l_arr_[i+1]->find_prebroken_piece (LEFT)));
+ a.push (Rod (l, rb));
}
if (lb && rb)
{
- Rod r((Single_malt_grouping_item*)
- spacing_unit_l_arr_[i]->find_prebroken_piece (RIGHT),
- (Single_malt_grouping_item*)
- spacing_unit_l_arr_[i+1]->find_prebroken_piece (LEFT));
- r.distance_f_ += paper ()->interline_f () *1.5;
- a.push (r);
+ Rod rod(lb, rb);
+ rod.distance_f_ += paper ()->interline_f () *1.5;
+ a.push (rod);
}
}
notes.push (info.o_ - left);
}
Encompass_info info (encompass_arr_[encompass_arr_.size () - 1], dir_);
+
// urg:
Slur* urg = (Slur*)this;
urg->interstaff_f_ = info.interstaff_f_;
+
d.y () += interstaff_f_;
// prebreak
-/*
- span-bar-grav.cc -- implement Span_bar_engraver
+#include "base-span-bar-engraver.hh"
- source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "span-bar.hh"
-#include "span-bar-engraver.hh"
-#include "vertical-align-spanner.hh"
-
-Span_bar_engraver::Span_bar_engraver()
-{
- spanbar_p_ =0;
- valign_l_ =0;
-}
-
-Span_bar*
-Span_bar_engraver::get_span_bar_p() const
-{
- return new Span_bar;
-}
-
-
-void
-Span_bar_engraver::do_creation_processing ()
-{
-}
-
-void
-Span_bar_engraver::do_removal_processing ()
+class Span_bar_engraver : public Base_span_bar_engraver
{
-}
-
-void
-Span_bar_engraver::acknowledge_element (Score_element_info i)
-{
- int depth = i.origin_grav_l_arr_.size();
- if (depth > 1
- && dynamic_cast<Bar *> (i.elem_l_))
- {
- bar_l_arr_.push (dynamic_cast<Bar *> (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
- */
+protected:
+ Span_bar *get_span_bar_p ();
+public:
+ Span_bar_engraver ();
+ VIRTUAL_COPY_CONS (Translator);
+};
- /*
- use a property? get_property ("singleStaffBracket", 0) ?
-
- --hwn
- */
- {
- spanbar_p_ = get_span_bar_p();
- announce_element (Score_element_info (spanbar_p_,0));
- spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_;
- }
- }
- else if (dynamic_cast<Vertical_align_spanner *> (i.elem_l_)
- && i.origin_grav_l_arr_.size() <= 2)
- {
- valign_l_ = dynamic_cast<Vertical_align_spanner *> (i.elem_l_);
- }
-}
-
-void
-Span_bar_engraver::do_pre_move_processing()
+Span_bar_engraver::Span_bar_engraver ()
{
- 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);
+ use_priority_b_ = false;
}
-
-
ADD_THIS_TRANSLATOR(Span_bar_engraver);
#include "span-bar.hh"
#include "lookup.hh"
#include "dimensions.hh"
-#include "atom.hh"
+
#include "paper-def.hh"
#include "molecule.hh"
#include "align-element.hh"
Interval
Span_bar::do_width () const
{
+ if (no_width_b_)
+ {
+ return Interval (0,0);
+ }
+
Molecule m = lookup_l ()->bar (type_str_, 40 PT);
return m.extent (X_AXIS);
Bar::do_pre_processing ();
evaluate_empty ();
+ translate_axis (extra_x_off_, X_AXIS);
+
+ dim_cache_[Y_AXIS].set_empty (false); // a hack to make mark scripts work.
}
void
}
}
-Molecule
-Span_bar::get_bar_sym (Real dy) const
-{
- if (dy < paper ()->staffheight_f () / 2)
- return Atom ();
-
- return lookup_l ()->bar (type_str_, dy);
-}
-
-Molecule*
-Span_bar::do_brew_molecule_p () const
+Interval
+Span_bar::get_spanned_interval () const
{
Interval y_int;
for (int i=0; i < spanning_l_arr_.size (); i++)
y_int.unite (y + spanning_l_arr_[i]->extent(Y_AXIS));
}
+ return y_int;
+}
+
+Interval
+Span_bar::do_height () const
+{
+ return get_spanned_interval ();
+}
+
+Molecule*
+Span_bar::do_brew_molecule_p () const
+{
+ Interval iv (get_spanned_interval ());
+ Molecule*output = new Molecule (lookup_l ()->bar (type_str_, iv.length ()));
- Molecule*output = new Molecule (get_bar_sym (y_int.length ()));
- output->translate_axis (y_int.center (), Y_AXIS);
+ output->translate_axis (iv.center (), Y_AXIS);
return output;
}
Span_bar::Span_bar ()
{
type_str_ = "";
+ extra_x_off_ = 0.0;
+ no_width_b_ = false;
}
/*
- span-score-bar-grav.cc -- implement Span_score_bar_engraver,
+ span-score-bar-engraver.cc -- implement Span_score_bar_engraver,
Piano_bar_engraver and Staff_group_bar_engraver
source file of the GNU LilyPond music typesetter
(c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "span-score-bar.hh"
-#include "piano-brace.hh"
-#include "staff-bracket.hh"
+#include "span-bar.hh"
#include "span-score-bar-engraver.hh"
#include "paper-def.hh"
-
Span_bar*
Span_score_bar_engraver::get_span_bar_p () const
{
- Span_bar*s = new Span_score_bar;
- s->break_priority_i_ = -4;
+ Span_bar*s = new Span_bar;
+ s->visibility_lambda_
+ = gh_eval_str ("spanbar_non_postbreak_visibility");
+ s->type_str_ = "scorebar";
return s;
}
-
-
-
+Span_score_bar_engraver::Span_score_bar_engraver ()
+{
+ use_priority_b_ = true;
+ break_priority_i_ = -4;
+}
Span_bar*
Piano_bar_engraver::get_span_bar_p () const
{
- Span_bar *s= new Piano_brace;
- s->break_priority_i_ = -4;
+ Span_bar *s= new Span_bar;
+ s->visibility_lambda_
+ = gh_eval_str ("spanbar_postbreak_only_visibility");
+ s->no_width_b_ =true;
+ s->type_str_ = "{";
return s;
}
Span_bar*
Staff_group_bar_engraver::get_span_bar_p () const
{
- Span_bar *s= new Staff_bracket;
- s->break_priority_i_ = -4;
+ Span_bar *s= new Span_bar;
+ s->visibility_lambda_
+ = gh_eval_str ("spanbar_postbreak_only_visibility");
+ s->no_width_b_ =true;
+ s->type_str_ = "[";
return s;
}
void
Staff_group_bar_engraver::acknowledge_element (Score_element_info i)
{
- Span_bar_engraver::acknowledge_element (i);
- if (dynamic_cast<Piano_brace *> (i.elem_l_))
+ Base_span_bar_engraver::acknowledge_element (i);
+ if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
{
- Span_bar* b = dynamic_cast <Span_bar *> (i.elem_l_);
- Piano_brace * piano_l = (Piano_brace*) b;
- piano_l->extra_move_left_f_ = paper ()->interline_f (); // ugh
+ if (b->type_str_ == "{")
+ b->extra_x_off_ -= paper ()->interline_f (); // ugh
}
}
+++ /dev/null
-/*
- span-score-bar.cc -- implement Span_score_bar
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "span-score-bar.hh"
-#include "atom.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "main.hh"
-
-Span_score_bar::Span_score_bar()
-{
-}
-
-
-void
-Span_score_bar::do_pre_processing()
-{
- /*
- duh. The order of these two is subtle.
- */
- Score_bar::do_pre_processing ();
- // Span_bar::do_pre_processing();
-}
-
-
-
-
Score_column*
Spring_spacer::scol_l (int i)
{
- return (Score_column*)cols_[i].pcol_l_;
+ return dynamic_cast<Score_column*>(cols_[i].pcol_l_);
}
const Real COLFUDGE=1e-3;
Line_of_cols
Spring_spacer::error_pcol_l_arr() const
{
- Array<Paper_column*> retval;
+ Link_array<Paper_column> retval;
for (int i=0; i< cols_.size(); i++)
if (cols_[i].ugh_b_)
retval.push (cols_[i].pcol_l_);
+++ /dev/null
-/*
- span-score-bar.cc -- implement Span_score_bar
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "staff-bracket.hh"
-#include "atom.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "main.hh"
-
-Molecule
-Staff_bracket::get_bar_sym (Real dy) const
-{
- Atom a = lookup_l ()->vbracket (dy);
- a.translate_axis (- 1.33 * a.extent ().x ().length (), X_AXIS);
- return Molecule (a);
-}
-
-Interval
-Staff_bracket::do_width() const
-{
- return Interval (0,0);
-}
-
-
-void
-Staff_bracket::do_post_processing ()
-{
- Span_score_bar::do_post_processing();
- Interval i = Span_score_bar::do_height ();
- // don't set bracket that spans less than one staff
- Real staffheight_f = paper ()->staffheight_f ();
- if (i.length () < 0.5 * staffheight_f)
- {
- transparent_b_ = true;
- set_empty (true);
- }
-}
-
-
-
-
axis_ = X_AXIS;
type_ = "margin";
visibility_lambda_
- = gh_eval_str ("(lambda (d) (if (= d 1) '(#f . #f) '(#t . #t)))");
+ = gh_eval_str ("postbreak_only_visibility");
}
void
Staff_performer::play (Audio_element* p)
{
- if (dynamic_cast<Audio_item *> (p))
+ if (Audio_item *ai = dynamic_cast<Audio_item *> (p))
{
- audio_staff_p_->add_audio_item ( (Audio_item*)p);
+ audio_staff_p_->add_audio_item (ai);
}
Performer::play (p);
}
if (!(abs (coordinate_offset_f_i) % 2))
y += (Real)dir_ * inter_f;
}
-// else
-// y = v[dir_] + 1 * dir_ * inter_f;
return y;
}
return Interval (0,0);
}
-Interval
-Staff_side::symbol_width () const
-{
- return Interval (0,0);
-}
-
void
Staff_side::do_pre_processing ()
{
if (axis_ == Y_AXIS)
return symbol_height ();
else
- return symbol_width ();
+ {
+ assert (false);
+ }
}
Staff_symbol::do_brew_molecule_p() const
{
Real w = extent (X_AXIS).length ();
- Real left_dx = -spanned_drul_[LEFT]->extent (X_AXIS)[LEFT];
- Real right_dx = spanned_drul_[RIGHT]->extent (X_AXIS)[RIGHT];
-
Paper_def * p = paper();
- Atom rule = lookup_l ()->rule_symbol (p->get_var ("rulethickness"),
- w);
+ Molecule rule = lookup_l ()->rule_symbol (p->get_var ("rulethickness"),
+ w);
Real height = (no_lines_i_-1) * inter_note_f();
Molecule * m = new Molecule;
for (int i=0; i < no_lines_i_; i++)
{
- Atom a (rule);
+ Molecule a (rule);
a.translate_axis (height - i * inter_note_f()*2, Y_AXIS);
m->add_molecule (a);
}
- // m->translate_axis (-left_dx, X_AXIS);
return m;
}
#include "proto.hh"
#include "misc.hh"
#include "debug.hh"
-#include "atom.hh"
+
#include "stem.hh"
#include "paper-def.hh"
#include "lookup.hh"
Stem::add_head (Rhythmic_head *n)
{
n->add_dependency (this); // ?
- if (dynamic_cast<Note_head *> (n))
+ if (Note_head *nh = dynamic_cast<Note_head *> (n))
{
- head_l_arr_.push ((Note_head*)n);
+ head_l_arr_.push (nh);
}
- else if (dynamic_cast<Rest *> (n))
+ else if (Rest *r = dynamic_cast<Rest *> (n))
{
- rest_l_arr_.push ((Rest*)n);
+ rest_l_arr_.push (r);
}
}
if (!invisible_b ())
{
- Atom ss =lookup_l ()->stem (stem_y[DOWN]*dy,
+ Molecule ss =lookup_l ()->stem (stem_y[DOWN]*dy,
stem_y[UP]*dy);
- mol_p->add_atom (ss);
+ mol_p->add_molecule (ss);
}
if (!beam_l_ && abs (flag_i_) > 2)
{
- Atom fl = lookup_l ()->flag (flag_i_, dir_);
+ Molecule fl = lookup_l ()->flag (flag_i_, dir_);
fl.translate_axis(stem_y[dir_]*dy, Y_AXIS);
- mol_p->add_atom (fl);
+ mol_p->add_molecule (fl);
}
if (head_l_arr_.size())
+++ /dev/null
-/*
- template3.cc -- instantiate Atom
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "atom.hh"
-#include "molecule.hh"
-#include "cursor.tcc"
-#include "pcursor.tcc"
-#include "plist.tcc"
-
-POINTERLIST_INSTANTIATE(Atom);
(c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-
+#if 0
#ifndef __CYGWIN32__
#include "proto.hh"
#include "pcursor.hh"
#include "plist.tcc"
#endif
+#endif
return DOWN;
}
-Real
-Text_def::guess_width_f(Atom& a) const
-{
- return a.dim_.x ().length ();
-}
-
-Interval
-Text_def::width (Paper_def * p) const
-{
- Atom a = get_atom (p,CENTER);
-
- Interval i (0, guess_width_f (a));
- i += - (align_dir_ + 1)* i.center ();
- return i;
-}
void
Text_def::do_print() const
&& style_str_ == def->style_str_;
}
-Atom
-Text_def::get_atom (Paper_def *p, Direction) const
+Molecule
+Text_def::get_molecule (Paper_def *p, Direction) const
{
- Atom a= p->lookup_l(0)->text (style_str_, text_str_);
+ Molecule a= p->lookup_l(0)->text (style_str_, text_str_);
- a.translate_axis (-(align_dir_ + 1)* guess_width_f (a) / 2, X_AXIS);
+ a.translate_axis (-(align_dir_ + 1)* a.dim_[X_AXIS].center (), X_AXIS);
return a;
}
G_staff_side_item *ss = new G_staff_side_item;
ss->set_victim (text);
ss->dir_ = r->dir_;
-
+ Scalar p (get_property ("textstyle", 0)); // textStyle?
+ if (p.length_i ())
+ text->style_str_ = p;
text->text_str_ = t->text_str_;
announce_element (Score_element_info (text, r));
#include "text-def.hh"
#include "debug.hh"
#include "paper-def.hh"
-#include "atom.hh"
+
void
Molecule*
Text_spanner::do_brew_molecule_p() const
{
- Atom tsym (spec_p_->get_atom (paper(),CENTER));
+ Molecule tsym (spec_p_->get_molecule (paper(),CENTER));
tsym.translate (text_off_);
Molecule*output = new Molecule;
- output->add_atom (tsym);
+ output->add_molecule (tsym);
return output;
}
Molecule*
Time_signature::do_brew_molecule_p () const
{
- Atom s;
if (time_sig_type_str_.length_i ())
{
if (time_sig_type_str_[0]=='1')
{
Array<int> tmparr = args_;
- tmparr[1]= 0;
- s = lookup_l ()->time_signature (tmparr);
+ return new Molecule( lookup_l ()->time_signature (args_[0], 0));
}
else
{
- s = lookup_l ()-> special_time_signature (time_sig_type_str_ ,args_);
+ return new Molecule( lookup_l ()-> special_time_signature (time_sig_type_str_ ,args_[0], args_[1]));
}
}
else
- s = lookup_l ()->time_signature (args_);
- s.translate_axis (-s.extent ()[Y_AXIS].center (), Y_AXIS);
- return new Molecule (Atom (s));
+ return new Molecule(lookup_l ()->time_signature (args_[0], args_[1]));
}
return 0;
}
-Array<Translator_ctor> *ctor_global_static_arr_p_;
-
-
-/*
- Very special greetings go out to Steve Jobs for creating a system
- that doesn't handle global construction correctly.
- */
-void
-add_constructor (Translator_ctor c)
-{
- if (!ctor_global_static_arr_p_)
- ctor_global_static_arr_p_ = new Array<Translator_ctor>;
- ctor_global_static_arr_p_->push (c);
-}
-
-void
-call_constructors ()
-{
- for (int i=0; i < ctor_global_static_arr_p_->size (); i++)
- add_translator (ctor_global_static_arr_p_->elem (i) ());
-}
todo: handle breaking elegantly.
*/
#include "beam.hh"
-#include "atom.hh"
+
#include "box.hh"
#include "debug.hh"
#include "lookup.hh"
if (column_arr_.size ()){
Real ncw = column_arr_.top ()->extent (X_AXIS).length ();
- Atom num (tdef_p_->get_atom (paper (), CENTER));
+ Molecule num (tdef_p_->get_molecule (paper (), CENTER));
if (beam_l_ && !bracket_visibility_b_)
{
- num.translate (((Directional_spanner*)beam_l_)->center ());
+ Directional_spanner* ds = dynamic_cast<Directional_spanner*>(beam_l_);
+ num.translate (ds->center ());
num.translate_axis (ncw, X_AXIS);
}
Real w = extent (X_AXIS).length () + ncw;
num.translate (Offset (w/2, dy/2));
- mol_p->add_atom (lookup_l ()->plet (dy, w, dir_));
+ mol_p->add_molecule (lookup_l ()->plet (dy, w, dir_));
}
if (num_visibility_b_)
- mol_p->add_atom (num);
+ mol_p->add_molecule (num);
}
return mol_p;
}
(c) 1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "atom.hh"
+
#include "box.hh"
#include "debug.hh"
#include "lookup.hh"
template class P<Text_def>; // UGH
-
Volta_spanner::Volta_spanner ()
{
last_b_ = false;
Real internote_f = paper ()->internote_f ();
Real dx = internote_f;
Real w = extent (X_AXIS).length () - dx;
- Atom volta (lookup_l ()->volta (w, last_b_));
+ Molecule volta (lookup_l ()->volta (w, last_b_));
Real h = volta.dim_.y ().length ();
- Atom num (number_p_->get_atom (paper (), LEFT));
+ Molecule num (number_p_->get_molecule (paper (), LEFT));
Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] >
column_arr_[0]->extent (Y_AXIS) [UP];
dy += 2 * h;
Text_def two_text;
two_text.text_str_ = "2";
two_text.style_str_ = number_p_->style_str_;
- Atom two (two_text.get_atom(paper (), LEFT));
+ Molecule two (two_text.get_molecule (paper (), LEFT));
Real gap = two.dim_.x ().length () / 2;
Offset off (num.dim_.x ().length () + gap,
h / internote_f - gap);
num.translate (off);
- mol_p->add_atom (volta);
- mol_p->add_atom (num);
+ mol_p->add_molecule (volta);
+ mol_p->add_molecule (num);
mol_p->translate (Offset (0, dy));
return mol_p;
}
set_bounds (RIGHT, column_arr_.top ());
}
- number_p_->style_str_ = "number-1";
+ number_p_->style_str_ = "number"; // number-1
}
Interval
--- /dev/null
+%
+% setup for auto beamer
+%
+time2_8beamAutoEnd = "2/8";
+time3_2beamAutoEnd = "1/2";
+time3_2beamAutoEnd16 = "1/4";
+time3_2beamAutoEnd32 = "1/8";
+time3_4beamAutoBegin = "1/4";
+time3_4beamAutoEnd8 = "3/4";
+time3_4beamAutoEnd32 = "1/8";
+time3_8beamAutoBegin = "1/8";
+time3_8beamAutoEnd = "3/8";
+time4_4beamAutoEnd8 = "1/2";
+time4_4beamAutoEnd32 = "1/8";
+time4_8beamAutoEnd8 = "1/4";
+time4_8beamAutoEnd16 = "1/4";
+time4_8beamAutoEnd32 = "1/8";
+time4_16beamAutoEnd = "1/8";
+time6_8beamAutoEnd8 = "3/8";
+time6_8beamAutoEnd16 = "3/8";
+time6_8beamAutoEnd32 = "1/8";
+time9_8beamAutoEnd8 = "3/8";
+time9_8beamAutoEnd16 = "3/8";
+time6_8beamAutoEnd32 = "1/8";
+++ /dev/null
-%
-% setup for auto beamer
-%
-time2_8beamAutoEnd = "2/8";
-time3_2beamAutoEnd = "1/2";
-time3_2beamAutoEnd16 = "1/4";
-time3_2beamAutoEnd32 = "1/8";
-time3_4beamAutoBegin = "1/4";
-time3_4beamAutoEnd8 = "3/4";
-time3_4beamAutoEnd32 = "1/8";
-time3_8beamAutoBegin = "1/8";
-time3_8beamAutoEnd = "3/8";
-time4_4beamAutoEnd8 = "1/2";
-time4_4beamAutoEnd32 = "1/8";
-time4_8beamAutoEnd8 = "1/4";
-time4_8beamAutoEnd16 = "1/4";
-time4_8beamAutoEnd32 = "1/8";
-time4_16beamAutoEnd = "1/8";
-time6_8beamAutoEnd8 = "3/8";
-time6_8beamAutoEnd16 = "3/8";
-time6_8beamAutoEnd32 = "1/8";
-time9_8beamAutoEnd8 = "3/8";
-time9_8beamAutoEnd16 = "3/8";
-time6_8beamAutoEnd32 = "1/8";
\include "property.ly"
-\scmfile "lily.scm";
+
unusedEntry = \notes { c4 } % reset default duration
% declare the standard dynamic identifiers.
%
-pppppp = \absdynamic { 13 }
-ppppp = \absdynamic { 12 }
-pppp = \absdynamic { 11 }
-ppp = \absdynamic { 10 }
-pp = \absdynamic { 9 }
-p = \absdynamic { 8 }
-mp = \absdynamic { 7 }
-mf = \absdynamic { 6 }
-f = \absdynamic { 5 } % f is a notename too.
-ff = \absdynamic { 4 }
-fff = \absdynamic { 3 }
-ffff = \absdynamic { 2 }
-fffff = \absdynamic { 1 }
-ffffff = \absdynamic { 0 }
+pppppp = \absdynamic { "pppppp" } % Yeah yeah, \absdynamic "foo"; would/should also work.
-fp = \absdynamic { 14 }
-sf = \absdynamic { 15 }
-sff = \absdynamic { 16 }
-sfz = \absdynamic { 17 }
-sp = \absdynamic { 18 }
-spp = \absdynamic { 19 }
-rfz = \absdynamic { 20 }
+ppppp = \absdynamic { "ppppp" }
+pppp = \absdynamic { "pppp" }
+ppp = \absdynamic { "ppp" }
+pp = \absdynamic { "pp" }
+p = \absdynamic { "p" }
+mp = \absdynamic { "mp" }
+mf = \absdynamic { "mf" }
+f = \absdynamic { "f" }
+ff = \absdynamic { "ff" }
+fff = \absdynamic { "fff" }
+ffff = \absdynamic { "ffff" }
+fffff = \absdynamic { "fffff" }
+ffffff = \absdynamic { "ffffff" }
+
+fp = \absdynamic { "fp" }
+sf = \absdynamic { "sf" }
+sff = \absdynamic { "sff" }
+sfz = \absdynamic { "sfz" }
+sp = \absdynamic { "sp" }
+spp = \absdynamic { "spp" }
+rfz = \absdynamic { "rfz" }
cr = \spandynamic { 1 1 }
decr = \spandynamic { -1 1 }
\consists "Stem_engraver";
\consists "Beam_engraver";
\consists "Auto_beam_engraver";
- \include "auto-beam.ly";
+ \include "auto-beam-settings.ly";
\consists "Abbreviation_beam_engraver";
% \consists "Multi_measure_rest_engraver";
tuplet_thick = 1.0*\staffline;
volta_thick = 1.6*\staffline;
+extender_height = 0.8*\staffline;
+
\include "engraver.ly";
Begin3
Titel: LilyPond
-Versie: 1.1.27
-Inschrijf datum: 03FEB99
+Versie: 1.1.28
+Inschrijf datum: 08FEB99
Beschrijving: @FLAPTEKST@
Trefwoorden: muziek typezetten midi notatie
Auteur: hanwen@stack.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys)
Voornaamste plek: sunsite.unc.edu /pub/Linux/apps
- 770k lilypond-1.1.27.tar.gz
+ 770k lilypond-1.1.28.tar.gz
Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 770k lilypond-1.1.27.tar.gz
+ 770k lilypond-1.1.28.tar.gz
Copi-eer voorwaarden: GPL
End
Begin3
Title: LilyPond
-Version: 1.1.27
-Entered-date: 03FEB99
+Version: 1.1.28
+Entered-date: 08FEB99
Description:
LilyPond is the GNU Project music typesetter. This program can print
beautiful sheet music from a music definition file. It can also play
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 770k lilypond-1.1.27.tar.gz
+ 770k lilypond-1.1.28.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 770k lilypond-1.1.27.tar.gz
+ 770k lilypond-1.1.28.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.1.27
+Version: 1.1.28
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.27.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.28.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>
EXTRA_DIST_FILES += TODO README feta.mp mfplain.ini
-FET_FILES = $(wildcard feta[0-9]*.mf) feta-din10.mf \
- $(wildcard feta-nummer[0-9]*.mf)
+FET_FILES = $(wildcard feta[0-9]*.mf)
LYTABLES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.ly))
LOG_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.log))
% -*- Fundamental -*-
+
+
accreg_dot_size# := .7interline#;
accreg_linethickness# := 1.3stafflinethickness#;
-%
+% -*-Fundamental-*-
% feta-bolletjes.mf -- implement noteheads
%
% source file of LilyPond's pretty-but-neat music font
save black_notehead_width;
numeric black_notehead_width;
-fet_begingroup("balls");
+fet_begingroup("noteheads");
noteheight#:=interline#+ (1 + overdone_heads) *stafflinethickness#;
define_pixels(noteheight);
draw z1 .. z2;
enddef;
+fet_beginchar("Ledger ending", "ledgerending", "ledgerending")
+set_char_box (5/2 ledgerlinethickness#, 5/2 ledgerlinethickness#,
+ ledgerlinethickness#/2,ledgerlinethickness#/2);
+ pickup pencircle scaled ledgerlinethickness;
+ lft x1 = -b;
+ rt x2 = w;
+ y1 =0; y2 =0;
+ draw z1 .. z2;
+fet_endchar;
+
fet_beginchar("Brevis notehead", "-1", "brevisball")
draw_brevis(brevis_wid#);
fet_endchar;
-fet_beginchar("Brevis ledger", "-1l", "brevisledger")
- draw_ledger(brevis_wid#);
-fet_endchar;
%
% Some sources (eg Musix/OpusTeX think that the appendage should be on
fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
penlabels(6,7);
fet_endchar;
-fet_beginchar("Longa ledger", "-2l", "longaledger")
- draw_ledger(brevis_wid#);
-fet_endchar;
% setup user vars
fet_endchar;
-fet_beginchar("Whole ledger line", "0l", "wholeledger")
- draw_ledger(whole_notehead_width#);
-fet_endchar;
% half note
% Wanske, p.39
fet_endchar;
-fet_beginchar("Half ledger", "1l", "halfledger")
- draw_ledger(half_notehead_width#);
-fet_endchar;
% quarter note
% Wanske p.38
fet_endchar;
-fet_beginchar("Quart ledger", "2l", "quartledger")
- draw_ledger(black_notehead_width#);
-fet_endchar;
draw_harmonic_notehead(harmonic_wid#)
fet_endchar;
-fet_beginchar("Harmonic ledger", "harmonicl", "harmonicledger")
- draw_ledger(harmonic_wid#);
-fet_endchar;
%fi
-fet_endgroup("balls");
+fet_endgroup("noteheads");
define_pixels(black_notehead_width);
stroke
} bind def
-/draw_slur
+% this is for drawing slurs.
+/draw_bezier_sandwich
{
stafflinethickness setlinewidth
moveto
;
; (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
-; TODO
-; - naming
-; - ready ps code (draw_bracket) vs tex/ps macros/calls (pianobrace),
-; all preparations from ps,tex to scm
+
+(debug-enable 'backtrace)
;;; library funtions
(define
(define security-paranoia #f)
-;;;;;;;;
-;;; UGH. THESE SUCK!
-
-(define (empty)
- "")
-
-(define (empty1 a)
- "")
-
-(define (empty2 a b )
- "")
-
-(define emptybar empty1)
-
-;;; and these suck as well.
-(define (setdynamic s) (text "dynamic" (string-append "\\" s)))
-(define (setroman s) (text "text" s))
-(define (settypewriter s) (text "typewriter" s))
-(define (setnumber s) (text "number" s))
-(define (setbold s) (text "bold" s))
-(define (setlarge s) (text "large" s))
-(define (setLarge s) (text "Large" s))
-(define (setmark s) (text "mark" s))
-(define (setfinger s) (text "finger" s))
-(define (setitalic s) (text "italic" s))
-(define (setnumber-1 s) (text "numberj" s))
-
+;; See documentation of Item::visibility_lambda_
+(define (postbreak_only_visibility d) (if (= d 1) '(#f . #f) '(#t . #t)))
+(define (non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
+(define (spanbar_non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
+(define (spanbar_postbreak_only_visibility d) (if (= d 1) '(#f . #f) '(#t . #t)))
;;;;;;;; TeX
(define (unknown)
"%\n\\unknown%\n")
+ (define font-alist '())
+ (define font-count 0)
+ (define current-font "")
+ (define (clear-fontcache)
+ (begin
+ (set! font-alist '())
+ (set! font-count 0)
+ (set! current-font "")))
+
+ (define (cached-fontname i)
+ (string-append
+ "\\lilyfont"
+ (make-string 1 (integer->char (+ 65 i)))
+ )
+ )
+
+ (define (select-font font-name)
+ (if (not (equal? font-name current-font))
+ (begin
+ (set! current-font font-name)
+ (define font-cmd (assoc font-name font-alist))
+ (if (eq? font-cmd #f)
+ (begin
+ (set! font-cmd (cached-fontname font-count))
+ (set! font-alist (acons font-name font-cmd font-alist))
+ (set! font-count (+ 1 font-count))
+ (string-append "\\font" font-cmd "=" font-name font-cmd)
+ )
+ (cdr font-cmd))
+ )
+
+ "" ;no switch needed
+
+ )
+
+ )
+
+
+
(define (beam width slope thick)
(embedded-ps ((ps-scm 'beam) width slope thick)))
(define (decrescendo w h cont)
(embedded-ps ((ps-scm 'decrescendo) w h cont)))
- (define
- (doublebar h)
- (invoke-dim1 "doublebar" h))
(define (embedded-ps s)
(string-append "\\embeddedps{" s "}"))
(define (experimental-on) "\\turnOnExperimentalFeatures")
- (define (extender h)
- (invoke-dim1 "extender" h))
- (define
- (fatdoublebar h)
- (invoke-dim1 "fatdoublebar" h))
- (define
- (finishbar h)
- (invoke-dim1 "finishbar" h))
+
(define (font-switch i)
(string-append
(string-append
"{\\bracefont " (char (/ (- (min y (- maxht step)) minht) step)) "}"))
- (define
- (repeatbar h)
- (invoke-dim1 "repeatbar" h))
- (define
- (repeatbarstartrepeat h)
- (invoke-dim1 "repeatbarstartrepeat" h))
(define (rulesym h w)
(string-append
)
)
- (define (slur l)
- (embedded-ps ((ps-scm 'slur) l)))
-
- (define
- (startbar h)
- (invoke-dim1 "startbar" h))
+ (define (bezier-sandwich l)
+ (embedded-ps ((ps-scm 'bezier-sandwich) l)))
- (define
- (startrepeat h)
- (invoke-dim1 "startrepeat" h))
- (define (start-line)
- (string-append
- "\\hbox{%\n")
+ (define (start-line)
+ (begin
+ (clear-fontcache)
+ "\\hbox{%\n")
)
- (define (filledbox breapth width height depth)
+ (define (filledbox breapth width depth height)
(string-append
"\\kern" (number->dim (- breapth))
"\\vrule width " (number->dim (+ breapth width))
(define (stop-line)
"}\\interscoreline")
- (define
- (stoprepeat h)
- (invoke-dim1 "stoprepeat" h))
- (define (text f s)
- (string-append "\\set" f "{" (output-tex-string s) "}"))
+ (define (text s)
+ (string-append "\\hbox{" (output-tex-string s) "}"))
(define (tuplet dx dy thick dir)
(embedded-ps ((ps-scm 'tuplet) dx dy thick dir)))
(define (volta w thick last)
(embedded-ps ((ps-scm 'volta) w thick last)))
- (define (maatstreep h)
- (string-append "\\maatstreep{" (number->dim h) "}"))
-
- ; urg: generate me
+
+ ;; The procedures listed below form the public interface of TeX-scm.
+ ;; (should merge the 2 lists)
(cond ((eq? action-name 'all-definitions)
`(begin
(define beam ,beam)
(define bracket ,bracket)
(define crescendo ,crescendo)
(define dashed-slur ,dashed-slur)
- (define doublebar ,doublebar)
- (define emptybar ,emptybar)
(define decrescendo ,decrescendo)
- (define empty ,empty)
(define end-output ,end-output)
- (define extender ,extender)
- (define fatdoublebar ,fatdoublebar)
- (define finishbar ,finishbar)
(define font-def ,font-def)
(define font-switch ,font-switch)
(define generalmeter ,generalmeter)
(define invoke-char ,invoke-char)
(define invoke-dim1 ,invoke-dim1)
(define placebox ,placebox)
- (define repeatbar ,repeatbar)
- (define repeatbarstartrepeat ,repeatbarstartrepeat)
(define rulesym ,rulesym)
- (define slur ,slur)
- (define startbar ,startbar)
- (define startrepeat ,startrepeat)
- (define stoprepeat ,stoprepeat)
+ (define bezier-sandwich ,bezier-sandwich)
+ (define select-font ,select-font)
(define start-line ,start-line)
(define filledbox ,filledbox)
(define stop-line ,stop-line)
(define text ,text)
(define experimental-on ,experimental-on)
(define char ,char)
- (define maatstreep ,maatstreep)
(define pianobrace ,pianobrace)
(define volta ,volta)
))
((eq? action-name 'bracket) bracket)
((eq? action-name 'crescendo) crescendo)
((eq? action-name 'dashed-slur) dashed-slur)
- ((eq? action-name 'doublebar) doublebar)
((eq? action-name 'decrescendo) decrescendo)
- ((eq? action-name 'empty) empty)
((eq? action-name 'end-output) end-output)
- ((eq? action-name 'extender) extender)
- ((eq? action-name 'fatdoublebar) fatdoublebar)
- ((eq? action-name 'finishbar) finishbar)
((eq? action-name 'font-def) font-def)
((eq? action-name 'font-switch) font-switch)
((eq? action-name 'generalmeter) generalmeter)
((eq? action-name 'invoke-char) invoke-char)
((eq? action-name 'invoke-dim1) invoke-dim1)
((eq? action-name 'placebox) placebox)
- ((eq? action-name 'repeatbar) repeatbar)
- ((eq? action-name 'repeatbarstartrepeat) repeatbarstartrepeat)
((eq? action-name 'rulesym) rulesym)
- ((eq? action-name 'slur) slur)
- ((eq? action-name 'startbar) startbar)
- ((eq? action-name 'startrepeat) startrepeat)
- ((eq? action-name 'stoprepeat) stoprepeat)
+ ((eq? action-name 'bezier-sandwich) bezier-sandwich)
((eq? action-name 'start-line) start-line)
((eq? action-name 'stem) stem)
((eq? action-name 'stop-line) stop-line)
(numbers->string (list w h (inexact->exact cont)))
"draw_decrescendo"))
- (define (empty)
- "\n empty\n")
(define (end-output)
"\nshowpage\n")
(number->string y) " "
"rulesym"))
- (define (slur l)
+ (define (bezier-sandwich l)
(string-append
(apply string-append (map control->string l))
- " draw_slur"))
-
- (define (start-line)
- "\nstart_line {\n")
+ " draw_bezier_sandwich"))
+ (define (start-line)
+ (begin
+ (clear-fontcache)
+ "\nstart_line {\n"))
+
(define (stem kern width height depth)
(string-append (numbers->string (list kern width height depth))
"draw_stem" ))
- (define (stop-line)
- "}\nstop_line\n")
+ (define (stop-line)
+ "}\nstop_line\n")
(define (text f s)
(string-append "(" s ") set" f " "))
(define bracket ,bracket)
(define crescendo ,crescendo)
(define volta ,volta)
- (define slur ,slur)
+ (define bezier-sandwich ,bezier-sandwich)
(define dashed-slur ,dashed-slur)
(define decrescendo ,decrescendo)
- (define empty ,empty)
+
(define end-output ,end-output)
(define font-def ,font-def)
(define font-switch ,font-switch)
((eq? action-name 'bracket) bracket)
((eq? action-name 'crescendo) crescendo)
((eq? action-name 'volta) volta)
- ((eq? action-name 'slur) slur)
+ ((eq? action-name 'bezier-sandwich) bezier-sandwich)
((eq? action-name 'dashed-slur) dashed-slur)
((eq? action-name 'decrescendo) decrescendo)
(else (error "unknown tag -- PS-SCM " action-name))
)
+;
+; Russ McManus, <mcmanus@IDT.NET>
+;
+; I use the following, which should definitely be provided somewhere
+; in guile, but isn't, AFAIK:
+;
+;
+(define (hash-table-for-each fn ht)
+ (do ((i 0 (+ 1 i)))
+ ((= i (vector-length ht)))
+ (do ((alist (vector-ref ht i) (cdr alist)))
+ ((null? alist) #t)
+ (fn (car (car alist)) (cdr (car alist))))))
+
+(define (hash-table-map fn ht)
+ (do ((i 0 (+ 1 i))
+ (ret-ls '()))
+ ((= i (vector-length ht)) (reverse ret-ls))
+ (do ((alist (vector-ref ht i) (cdr alist)))
+ ((null? alist) #t)
+ (set! ret-ls (cons (fn (car (car alist)) (cdr (car alist))) ret-ls)))))
% stacked horizontal lines
\def\interscoreline{\vskip 16pt}
-\def\setdynamic#1{\dynfont #1}
-\def\setfinger#1{\fingerfont #1}
-\def\setnumber#1{\fetanummer #1}
-\def\setnumberj#1{\fetanummerj #1}
-\def\setmark#1{\markfont #1}
% big fat marks, if errors are detected.
\def\columnerrormark{\placebox{-5pt}{0pt}{\bf C!}}
%{\bf u} %FIXME
}
-\input dyndefs
\input fetdefs
-\def\deprecated#1S{%%%%%%%%%
-
-\def\emptybar{}
-
-
-
-\def\defaultthinbar{\thinbar{\staffheight}}
-\def\defaultthickbar{\thickbar{\staffheight}}
-%? what-s wrong with rightalign?
-\def\repeatstopbar{\rightalign{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar}}
-\def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}}
-\def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern2\smallspace\repeatcolon}}
-
-%compatibility
-%urg
-\fetdef\repeatcolon{21}
-\def\repeatbar#1{\repeatstopbar}
-\def\startrepeat#1{\repeatstartbar}
-\def\repeatbarstartrepeat#1{\repeatstopstart}
-
-\def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}}
-\def\thinbar#1{\dimen0=#1%
- \vrule height .5\dimen0 depth .5\dimen0 width 1.6\stafflinethickness} % TODO parametric.
-\def\thickbar#1{\dimen0=#1%
- \vrule height .5\dimen0 depth .5\dimen0 width 2\smallspace}
-\def\maatstreep#1{\thinbar{#1}}
-\def\startbar#1{\leftalign{\thickbar{#1}\kern\smallspace\thinbar{#1}}}
-\def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}}
-\def\fatdoublebar#1{\hbox{\phantom{\repeatcolon\kern2\smallspace}\thickbar{#1}\kern\smallspace\thickbar{#1}}}
-}
-
-
-\def\extender#1{\vrule width#1 height .8\stafflinethickness}
-
% ugh
% see e.g. input/test/beam-pos.ly
%