From: Han-Wen Nienhuys Date: Sun, 24 Mar 2002 21:07:04 +0000 (+0100) Subject: release: 1.5.47 X-Git-Tag: release/1.5.47 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c380a7abde14a60ebd6d8a6eab91ae4e13677a23;p=lilypond.git release: 1.5.47 --- diff --git a/ChangeLog b/ChangeLog index f153772d05..363e387395 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,74 @@ +2002-03-24 Han-Wen + + * VERSION: 1.5.47 released + + * lily/line-spanner.cc (line_atom): change line-thickness to thickness + + * lily/porrectus.cc: change line-thickness to thickness, change + stem-direction to direction. + + * scm/backend-documentation-lib.scm (check-dangling-properties): + Automatically detect doc'ed properties that are not in an interface + + * scm/grob-property-description.scm: property cleanup. Remove many + paper-column props that are non-existent. + + * lily/grob.cc (Grob): only use molecule_extent_proc as default if + the grob has a molecule-callback. + + * lily/*.cc: remove many set_interface() calls, and their + implementations. + + * input/regression/spacing-knee.ly: new file + + * input/regression/spacing-clef-first-note.ly: new file + + * lily/staff-spacing.cc (get_spacing_params): different spacing + for pref matter to note at start of line, halfway during line. + + * lily/note-spacing.cc (stem_dir_correction): apply 2nd stem direction + correction only if stems have same direction (i.e. not for + stem-clef combination). + (stem_dir_correction): maximal correction for knees. + + * lily/*.cc: many updates to interface descriptions. + + * lily/grob.cc (internal_set_grob_property): add interface check + for every set_grob_property call + + * lily/*.cc: document interface stuff in C++ + + * lily/grob-interface.cc: new file. Add grob interfaces from C++. + + * lily/volta-bracket.cc: naming: change volta spanner to + volta-bracket. + + * input/bugs/*.ly: cleanup, remove lots of files. + + * buildscripts/mf-to-table.py (write_ps_encoding): generate + .encoding file. WARNING: upgrade to pktrace 1.0.3 + + * mf/feta-toevallig.mf: change PS name for parentheses. + +2002-03-23 Mats Bengtsson + + * scripts/ly2dvi.py (ly_paper_to_latexpaper): Use the correct unit + also for textheight + 2002-03-23 Han-Wen + * lily/scope.cc: remove file . + + * lily/include/scope.hh: remove file. Remove Scope class + * VERSION: 1.5.46 * lily/beam.cc (score_slopes_dy, score_stem_lengths, score_forbidden_quants): ): take out of SCM, pass parameters so grob props are read only once. (wtk1-fugue2 from 31 sec to 14 secs). + (calc_stem_y): robustness: take care of last_visible_stem == 0. + * lily/lily-guile.cc (ly_unit): return internal unit. @@ -48,6 +111,8 @@ * buildscripts/clean-fonts.sh: added search paths /var/cache/fonts and /usr/share/texmf/fonts + * scripts/ly2dvi.py: Read unit from paper vars (43.jcn3). + 2002-03-22 Han-Wen * lily/text-spanner.cc (brew_molecule): add #'thickness diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index ee9a1fdb41..4b1531f563 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -257,10 +257,16 @@ Grace note do weird things with timing. Fragile. @lilypondfile[printfilename]{lyrics-bar.ly} +@lilypondfile[printfilename]{spacing-knee.ly} + + + @lilypondfile[printfilename]{non-empty-text.ly} @lilypondfile[printfilename]{prefatory-spacing-matter.ly} +@lilypondfile[printfilename]{spacing-clef-first-note.ly} + @lilypondfile[printfilename]{spacing-bar-stem.ly} diff --git a/NEWS b/NEWS index ce25038d6f..4dd7ec9c36 100644 --- a/NEWS +++ b/NEWS @@ -5,10 +5,12 @@ New features in 1.5 * Figured bass support -* Improved grace notes +* Improved beam formatting. + +* Improved grace notes. * Better spacing. * More ancient notation support. -* Some entry optimizations +* Some entry optimizations. diff --git a/VERSION b/VERSION index 500f43c91c..e6d9e5925e 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 -PATCH_LEVEL=46 +PATCH_LEVEL=47 MY_PATCH_LEVEL= diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 820dc6e691..ee15b10d46 100755 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -122,6 +122,16 @@ def write_tex_defs (file, global_info, charmetrics): for m in charmetrics: file.write (r'''\def\%s%s{\char%d}%s''' % (nm, m['tex'], m['code'],'\n')) +def write_ps_encoding (file, global_info, charmetrics): + encs = ['.notdef'] * 256 + for m in charmetrics: + encs[m['code']] = m['tex'] + + file.write ('/FetaEncoding [\n') + for m in range(0,256): + file.write (' /%s %% %d\n' % (encs[m], m)) + file.write ('] def\n') + def write_fontlist (file, global_info, charmetrics): nm = global_info['FontFamily'] file.write (r""" @@ -177,9 +187,10 @@ Options: (options, files) = getopt.getopt( sys.argv[1:], 'a:d:hl:o:p:t:', - ['afm=', 'outdir=', 'dep=', 'tex=', 'ly=', 'debug', 'help', 'package=']) + ['enc=', 'afm=', 'outdir=', 'dep=', 'tex=', 'ly=', 'debug', 'help', 'package=']) +enc_nm = '' texfile_nm = '' depfile_nm = '' afmfile_nm = '' @@ -195,6 +206,8 @@ for opt in options: outdir_prefix = a elif o == '--tex' or o == '-t': texfile_nm = a + elif o == '--enc': + enc_nm = a elif o == '--ly' or o == '-': lyfile_nm = a elif o== '--help' or o == '-h': @@ -220,6 +233,8 @@ for filenm in files: write_afm_metric (afm, g,m) write_tex_defs (open (texfile_nm, 'w'), g, m) + write_ps_encoding (open (enc_nm, 'w'), g, m) + write_deps (open (depfile_nm, 'wb'), deps, [base + '.dvi', texfile_nm, afmfile_nm]) if lyfile_nm != '': write_fontlist(open (lyfile_nm, 'w'), g, m) diff --git a/input/bugs/accents.ly b/input/bugs/accents.ly deleted file mode 100644 index 6d26098115..0000000000 --- a/input/bugs/accents.ly +++ /dev/null @@ -1,13 +0,0 @@ -\version "1.3.148" -\score { - \context Staff \notes\relative c''< - \context Voice=one { - \voiceOne - e2-> - } - \context Voice=two { - \voiceTwo - f,2-> - } - > -} \ No newline at end of file diff --git a/input/bugs/ancient-font.ly b/input/bugs/ancient-font.ly deleted file mode 100644 index 6aef817e6b..0000000000 --- a/input/bugs/ancient-font.ly +++ /dev/null @@ -1,132 +0,0 @@ -\version "1.3.148" -\header { -texidoc="setting staff symbol properties the normal way is broken" - title = "ancient font test" - date = "2000" -} - - - -\include "paper26.ly" - -global = \notes { - \property Score.timing = ##f -% \property Staff.TimeSignature \override #'style = #'old -} - -upperVoice = \context Staff = upperVoice < - \global - \property Staff.StaffSymbol \override #'line-count = #4 - \notes \transpose c' { - \property Voice.NoteHead \override #'style = #'mensural - \property Voice.Stem \override #'stem-centered = ##t - \property Staff.Custos \override #'style = #'vaticana - \clef "vaticana_fa2" - c2 d e f g - -% \property Staff.clefGlyph = #"clefs-vaticana_do" -% \property Staff.clefPosition = #1 -% \property Staff.clefOctavation = #0 - \clef "vaticana_do2" - - a b c' - b a g f - \clef "vaticana_fa1" - e d c1 \bar "|" - - \property Staff.Custos \override #'style = #'medicaea - \clef "medicaea_fa2" - c2 d e f g - \clef "medicaea_do2" - a b c' - b a g f - \clef "medicaea_fa1" - e d c1 \bar "|" - - \property Staff.Custos \override #'style = #'hufnagel - \clef "hufnagel_fa2" - c2 d e f g - \clef "hufnagel_do2" - a b c' - b a g f - \clef "hufnagel_fa1" - e d c1 \bar "||" - } -> - -lowerVoice = \context Staff = lowerNotes < - \global - \property Staff.StaffSymbol \override #'line-count = #5 - \notes \transpose c' { - \property Voice.NoteHead \override #'style = #'mensural - \property Voice.Stem \override #'stem-centered = ##t - \property Staff.Custos \override #'style = #'mensural - \clef "mensural1_c2" - c2 d e f g - \property Staff.forceClef = ##t - \clef "mensural1_c2" - a b c' - b a g f - \clef "mensural2_c2" - e d c1 \bar "|" - - \clef "mensural2_c2" - c2 d e f g - \property Staff.forceClef = ##t - \clef "mensural3_c2" - a b c' - b a g f - \clef "mensural3_c2" - e d c1 \bar "|" - - \clef "mensural1_f" - c2 d e f g - \property Staff.forceClef = ##t - \clef "mensural1_f" - a b c' - b a g f - \clef "mensural2_f" - e d c1 \bar "|" - - \property Staff.forceClef = ##t - \clef "mensural2_f" - c2 d e f g - \clef "mensural_g" - a' b' c'' - b' a' g' f' - \property Staff.forceClef = ##t - \clef "mensural_g" - e' d' c'1 \bar "|" - - \property Staff.forceClef = ##t - \clef "mensural_g" - c'2 d' e' f' g' - \clef "hufnagel_do_fa" - a b c' - b a g f - \property Staff.forceClef = ##t - \clef "hufnagel_do_fa" - e d c1 \bar "||" - } -> - -\score { - \context ChoirStaff < - \upperVoice - \lowerVoice - > - \paper { -% \paperTwentysix - linewidth = 17.25\cm - textheight = 26.0\cm - indent = 0.0 - \translator { - \StaffContext - \consists Custos_engraver -% Custos \override #'style = #'mensural - \remove Time_signature_engraver -% StaffSymbol \override #'line-count = #4 - } - } -} - diff --git a/input/bugs/auto-beam.ly b/input/bugs/auto-beam.ly index 3a7687cdc4..d84265fc27 100644 --- a/input/bugs/auto-beam.ly +++ b/input/bugs/auto-beam.ly @@ -1,6 +1,7 @@ \version "1.3.148" \header { + texidoc="The Automatic beamer does not put @strong{unfinished} beams on the last notes of a score." } diff --git a/input/bugs/beaming.ly b/input/bugs/beaming.ly deleted file mode 100644 index 54d1d38f9b..0000000000 --- a/input/bugs/beaming.ly +++ /dev/null @@ -1,9 +0,0 @@ -\header { -texidoc="Automatic beamer behaves differently in different measuere locations." -} -\version "1.3.148" - -\score { \notes { - - [\times 2/3 {c16 c c} c8] - [\times 2/3 {c16 c c} c8]}} diff --git a/input/bugs/clefsp.ly b/input/bugs/clefsp.ly deleted file mode 100644 index 91f8fe49f6..0000000000 --- a/input/bugs/clefsp.ly +++ /dev/null @@ -1,20 +0,0 @@ - - - -\score{< - \notes \relative c'' \context Staff=violin{ - \time 3/4 -s2. - \grace a b4 - } - \notes \relative c'' \context Staff=violoncello{ - \time 3/4 - \clef tenor -s2. \clef bass b4 - } -> -\paper{ - linewidth=-1 -} -} - diff --git a/input/bugs/context-weirdness.ly b/input/bugs/context-weirdness.ly deleted file mode 100644 index b7f4a6e8eb..0000000000 --- a/input/bugs/context-weirdness.ly +++ /dev/null @@ -1,52 +0,0 @@ -\header { -texidoc = "context level weirdness. after some commands, explicit - \context Voice commands must be inserted; otherwise subsequent property - settings fail silently" -} - -% from les-nereides.ly - - #(define (make-text-checker text) - (lambda (elt) (equal? text (ly-get-grob-property elt 'text)))) - -\score { - \context PianoStaff < - \context Staff=upper \notes\relative c' { - \property Score.timing = ##f - - \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4) - c-"foe" - - \translator Staff=lower - - % staff switch moves us - % implicitely to staff level: text-checker won't see "foe" - \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4) - c-"foe" - - % get back to Voice level: it works again - \context Voice - \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4) - c-"foe" - - \clef treble - - % clef change moves us - % implicitely to staff level: text-checker won't see "foe" - \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4) - c-"foe" - - % get back to Voice level: it works again - \context Voice - \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4) - c-"foe" - - } - \context Staff=lower \notes\relative c' { - s - } - > - \paper { - linewidth = -1.0 - } -} \ No newline at end of file diff --git a/input/bugs/cross-staff-tie.ly b/input/bugs/cross-staff-tie.ly index 7dca649913..373901733f 100644 --- a/input/bugs/cross-staff-tie.ly +++ b/input/bugs/cross-staff-tie.ly @@ -1,4 +1,7 @@ +\header { + texidoc = "Tie code is not prepared for staff changes." +} \version "1.4.8" diff --git a/input/bugs/different-time.ly b/input/bugs/different-time.ly index 2db2460f2b..32e44eff65 100644 --- a/input/bugs/different-time.ly +++ b/input/bugs/different-time.ly @@ -2,7 +2,10 @@ \header { texidoc = " Spacing for one staff in polymetric music should -be not hampered by a staff in another time signature." +be not hampered by a staff in another time signature. + +FIXME example was broken at some point. +" } \score{ diff --git a/input/bugs/first-midi-tie.ly b/input/bugs/first-midi-tie.ly deleted file mode 100644 index 1fe7b0c92d..0000000000 --- a/input/bugs/first-midi-tie.ly +++ /dev/null @@ -1,31 +0,0 @@ -\header { - -texidoc=" - - Interpreting music... - m.ly:3:14: warning: No ties were created!: - ~ - - - MIDI output to `m.midi'... -" -} - -chordexamples = \notes \relative c' { - ~ - ~ - ~<\context Voice = x {} e'> - ~ -} - -\score { - \context PianoStaff < - \context Staff = upper < - \clef treble - \context Voice = i { \voiceOne \chordexamples } - > - > - \paper { } - \midi { \tempo 4 = 120 } -} - diff --git a/input/bugs/first-tie.ly b/input/bugs/first-tie.ly deleted file mode 100644 index f04fb2f951..0000000000 --- a/input/bugs/first-tie.ly +++ /dev/null @@ -1,11 +0,0 @@ -\header{ - texidoc="no tie is generated for first chord of score. workaround: begin -with s1*0 spacer note." - } - -\score { - \context Staff \notes { - % s1*0 - ~ - } -} \ No newline at end of file diff --git a/input/bugs/grace-finger.ly b/input/bugs/grace-finger.ly deleted file mode 100644 index 9fffe3a84e..0000000000 --- a/input/bugs/grace-finger.ly +++ /dev/null @@ -1,10 +0,0 @@ -\version "1.3.148" - - - % ? - -\score { -\notes \context Voice = VA \relative c'' { - \grace {[b8^1 c^2]} d4^3 -} -\paper {linewidth = -1. }} diff --git a/input/bugs/harakiri-autoknee.ly b/input/bugs/harakiri-autoknee.ly index 0a2a3c9fab..239c8a9d13 100644 --- a/input/bugs/harakiri-autoknee.ly +++ b/input/bugs/harakiri-autoknee.ly @@ -1,4 +1,7 @@ +% +% Autoknee-ing triggers hara-kiri too early. +% \score { \notes \transpose c''' \context PianoStaff < diff --git a/input/bugs/partial-beam.ly b/input/bugs/partial-beam.ly deleted file mode 100644 index 44898ea28b..0000000000 --- a/input/bugs/partial-beam.ly +++ /dev/null @@ -1,28 +0,0 @@ -\version "1.3.148" -%docme -- geen id, lijkt ok? - -\include "paper20.ly" -Sopnotes = \notes { - \time 4/4 - \key g \major - \clef treble - \partial 8 * 3 - e'8 f'8 g'8 | - d'8 d'16 d'16 e'8. e'16 g'8 g'8 f'8 f'8 -} - -\score { - \notes - < - \context Staff="sop" - < - \Sopnotes - > - > - \paper { - \translator { - \StaffContext - autoBeamSettings \override #'(end * * * * ) = #(make-moment 1 8) - } - } -} diff --git a/input/bugs/prefatory-spacing.ly b/input/bugs/prefatory-spacing.ly deleted file mode 100644 index 06e718bc2a..0000000000 --- a/input/bugs/prefatory-spacing.ly +++ /dev/null @@ -1,15 +0,0 @@ -\version "1.3.148" - -\header { texidoc= "Spacing after clef/key should be stretched -equidistantly for large stretching, but should stay clear of prefatory -matter for small stretching. Support in the spacing engine for -separate spring constants for stretching/shrinking is needed" -} - -foo = \notes\relative c'' { \key as \major f } - -\score { - - < \foo - > -} diff --git a/input/bugs/slur-steep-broken.ly b/input/bugs/slur-steep-broken.ly index 20320aaf05..7b4f6f12e5 100644 --- a/input/bugs/slur-steep-broken.ly +++ b/input/bugs/slur-steep-broken.ly @@ -1,3 +1,6 @@ + +% ?? + \version "1.3.148" \score{ @@ -7,7 +10,7 @@ [) a'8. gis16 fis8. cis16] | } \paper{ - linewidth = 3.0\cm + linewidth = 3.5\cm indent = .0 } } diff --git a/input/bugs/staff-size.ly b/input/bugs/staff-size.ly index e87807b7ca..91691782ce 100644 --- a/input/bugs/staff-size.ly +++ b/input/bugs/staff-size.ly @@ -1,4 +1,5 @@ \version "1.3.148" + \header{ texidoc="separate staff-size is clumsy with \override. Also, it doesn't seem to work anymore." diff --git a/input/bugs/standchen-space.ly b/input/bugs/standchen-space.ly index 275b0555c3..8520bee82e 100644 --- a/input/bugs/standchen-space.ly +++ b/input/bugs/standchen-space.ly @@ -1,11 +1,15 @@ \version "1.3.148" \header{ -texidoc="what about this. -> regression?" + + texidoc= "The 8th notes should have regular spacing. (TODO: check + with printed ed.) " + + } \score { \notes \relative c' < \context Staff = SA { c4. c8 \times 2/3 { [c8 c c] } } -\context Staff = SB { c8 c c c c c } +\context Staff = SB { [c8 c c c c c] } > \paper { linewidth = -1. } diff --git a/input/bugs/ties.ly b/input/bugs/ties.ly deleted file mode 100644 index cbd12e9913..0000000000 --- a/input/bugs/ties.ly +++ /dev/null @@ -1,22 +0,0 @@ -\version "1.3.148" - -\header { - texidoc="Positioning of last ties is incorrect ties between 2-1 and 1-1 - durations differ." -} - -\score { - \context Staff < - \context Voice = a \notes\relative c'' { - \voiceOne - r2 a2 a1~a - } - \context Voice = y \notes\relative c' { - \voiceTwo - r2 a2~a1~a - } - > - \paper { - linewidth = 100 * \staffspace - } -} diff --git a/input/bugs/triplets.ly b/input/bugs/triplets.ly deleted file mode 100644 index 0d0e62923a..0000000000 --- a/input/bugs/triplets.ly +++ /dev/null @@ -1,32 +0,0 @@ -\version "1.3.148" - -\header { -texidoc = "Simple beams. This broke somewhere < 1.3.110 -" - title = "Gammes Chromatiques" - composer = "" - filename = "gammes_chromatiques.ly" -} - -%{ - - At bar 3 of 2nd score, stems are too big (or the beams are - badly positionned) -%} - -exI = \notes \relative c' { - \repeat "volta" 2 { - \times 2/3 {c8( cis d} \times 2/3 {dis e f} - \times 2/3 {fis g gis} \times 2/3 {a bes b} | - \property Voice.TupletBracket \override #'tuplet-number-visibility = ##f - \property Voice.TupletBracket \override #'tuplet-bracket-visibility = ##f - \times 2/3 {c8 cis d} \times 2/3 {dis e f} - \times 2/3 {fis g gis} \times 2/3 {a bes b} | - \times 2/3 {c b bes} \times 2/3 {a aes g} - \times 2/3 {fis f e} \times 2/3 {ees d des} | - \times 2/3 {c b bes} \times 2/3 {a aes g} - \times 2/3 {fis f e} \times 2/3 {ees d )des} - } - c1 || \break -} - -\score { \context Staff { \notes { \exI } } } diff --git a/input/regression/molecule-hacking.ly b/input/regression/molecule-hacking.ly index d677d2d903..c27032118a 100644 --- a/input/regression/molecule-hacking.ly +++ b/input/regression/molecule-hacking.ly @@ -29,8 +29,8 @@ GROB. The dimensions of the molecule is not affected. (let* ( (fn (ly-get-default-font grob)) - (pclose (ly-find-glyph-by-name fn "accidentals-)")) - (popen (ly-find-glyph-by-name fn "accidentals-(")) + (pclose (ly-find-glyph-by-name fn "accidentals-rightparen")) + (popen (ly-find-glyph-by-name fn "accidentals-leftparen")) (subject (callback grob)) ; remember old size diff --git a/input/regression/spacing-clef-first-note.ly b/input/regression/spacing-clef-first-note.ly new file mode 100644 index 0000000000..c0d9258ddc --- /dev/null +++ b/input/regression/spacing-clef-first-note.ly @@ -0,0 +1,23 @@ +\header { + + texidoc = "clef changes at the start of a line get much more space +than clef changes halfway the line." + +} + +\score {\notes { + < \context Staff = SA { + c2 + \clef bass e16 f a + \clef treble b + } + \context Staff = SB { + c4 c4 c4 + }> + } + \paper { linewidth = -1. +\translator { \StaffContext + TimeSignature = \turnOff + } + + }} diff --git a/input/regression/spacing-knee.ly b/input/regression/spacing-knee.ly new file mode 100644 index 0000000000..3b51d5fc82 --- /dev/null +++ b/input/regression/spacing-knee.ly @@ -0,0 +1,13 @@ +\header { +texidoc = "For knees, the spacing correction is such that the +stems are put at regular distances. +" + } +\score { \notes +{ +[g''8 g g'' g''] + + } +\paper { linewidth = -1. } + } + diff --git a/input/test/ancient-font.ly b/input/test/ancient-font.ly index c7d6a70a5b..035fccf87b 100644 --- a/input/test/ancient-font.ly +++ b/input/test/ancient-font.ly @@ -39,8 +39,8 @@ upperVoice = \context Staff = upperVoice < \property Voice.Porrectus \override #'style = #'vaticana \property Voice.Porrectus \override #'solid = ##t \property Voice.Porrectus \override #'add-stem = ##t - \property Voice.Porrectus \override #'stem-direction = #-1 - \property Voice.Porrectus \override #'line-thickness = #0.5 + \property Voice.Porrectus \override #'direction = #-1 + \property Voice.Porrectus \override #'thickness = #0.5 \key es \major \clef "vaticana_fa2" c!1 des! e! f! ges! @@ -148,9 +148,9 @@ lowerVoice = \context Staff = lowerNotes < \property Voice.Porrectus \override #'solid = ##f \property Voice.Porrectus \override #'add-stem = ##t \property Voice.Porrectus \override #'stem-direction = #1 - \property Voice.Porrectus \override #'line-thickness = #0.7 + \property Voice.Porrectus \override #'thickness = #0.7 % \property Voice.Porrectus \override #'auto-properties = ##t -% \property Voice.Porrectus \override #'porrectus-width = #3.0 +% \property Voice.Porrectus \override #'width = #3.0 \key a \major % IMPORTANT NOTE: diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 5b476a05cb..8a3110cfb6 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -225,9 +225,7 @@ Accidental_engraver::create_grobs () if (!key_item_p_) { key_item_p_ = new Item (get_property ("Accidentals")); - Local_key_item::set_interface (key_item_p_); - Staff_symbol_referencer::set_interface (key_item_p_); SCM c0 = get_property ("centralCPosition"); if (gh_number_p (c0)) Staff_symbol_referencer::set_position (key_item_p_, gh_scm2int (c0)); diff --git a/lily/align-interface.cc b/lily/align-interface.cc index e326199e41..0344730184 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -270,15 +270,6 @@ Align_interface::add_element (Grob*me,Grob* s, SCM cb) Axis_group_interface::add_element (me, s); } - -void -Align_interface::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("align-interface")); - - Axis_group_interface::set_interface (me); -} - void Align_interface::set_axis (Grob*me,Axis a) { @@ -291,3 +282,13 @@ Align_interface::has_interface (Grob*me) return me && me->has_interface (ly_symbol2scm ("align-interface")); } + +ADD_INTERFACE (Align_interface, "align-interface", + " Order grobs top to bottom/left to right/right to left etc.", + "forced-distance stacking-dir align-dir threshold alignment-done center-element elements axes"); + + + +ADD_INTERFACE (Foobar, "aligned-interface", + "read by align-interface", + "minimum-space-pair extra-space"); diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index f480a6acb9..dcf1a03dac 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -109,3 +109,9 @@ Arpeggio::width_callback (SCM smob, SCM axis) return ly_interval2scm (arpeggio.extent (X_AXIS) * 1.5); } + + +ADD_INTERFACE (Arpeggio, "arpeggio-interface", + "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.", + "stems arpeggio-direction"); + diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index f22d068ffa..8c054c3d67 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -42,8 +42,6 @@ void Axis_group_engraver::initialize () { staffline_p_ = get_spanner_p (); - Axis_group_interface::set_interface (staffline_p_); - Axis_group_interface::set_axes (staffline_p_, Y_AXIS, Y_AXIS); Grob * it = unsmob_grob (get_property ("currentCommandColumn")); @@ -148,7 +146,7 @@ Spanner* Hara_kiri_engraver::get_spanner_p () const { Spanner * sp = new Spanner (get_property ("HaraKiriVerticalGroup")); - Hara_kiri_group_spanner::set_interface (sp); + return sp; } diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index d7074ef3a4..895b5597c9 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -130,11 +130,7 @@ Axis_group_interface::has_interface (Grob*me) return me && me->has_interface (ly_symbol2scm ("axis-group-interface")); } -void -Axis_group_interface::set_interface (Grob*me) -{ - if (!has_interface (me)) - { - me->set_interface (ly_symbol2scm ("axis-group-interface")); - } -} + +ADD_INTERFACE (Axis_group_interface, "axis-group-interface", + "a group of coupled grobs", + "axes"); diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 5aac74183e..e1bd060ccc 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -164,11 +164,6 @@ Bar_line::before_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -void -Bar_line::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("bar-line-interface")); -} bool Bar_line::has_interface (Grob*m) @@ -198,3 +193,38 @@ Bar_line::get_staff_bar_size (SCM smob) else return gh_int2scm (0); } + + + +ADD_INTERFACE (Bar_line, "bar-line-interface", + "Bar line. + +This is a request to print a special bar symbol. It replaces the +regular bar symbol with a special +symbol. The argument @var{bartype} is a string which specifies the +kind of bar to print. Options are @code{:|} +@cindex |A@@@code{:|} +, +@code{|:} +@cindex |B@@@code{|:} +, @code{:|:} +@cindex |C@@@code{:|:} +, +@code{||} +@cindex |D@@@code{||} +, @code{|.} +@cindex |E@@@code{|.} +, +@code{.|} +@cindex |F@@@code{.|} +, and @code{.|.} +@cindex |G@@@code{.|.} +. + +These produce, respectively, a right repeat, a left repeat, a double +repeat, a double bar, a start bar, an end bar, and a thick double bar. +If @var{bartype} is set to @code{empty} then nothing is printed, +but a line break is allowed at that spot. +" +, + "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function"); diff --git a/lily/beam.cc b/lily/beam.cc index 23d0998d1f..98b674ce84 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -286,7 +286,13 @@ Beam::consider_auto_knees (Grob *me) TODO: take some y-position (chord/beam/nearest?) into account - scmify forced-fraction */ + scmify forced-fraction + + TODO: + + why is shorten stored in beam, and not directly in stem? + +*/ void Beam::set_stem_shorten (Grob *m) { @@ -351,11 +357,15 @@ struct Quant_score /* TODO: + - Make all demerits customisable - - One sensible check per demerit + + - One sensible check per demerit (what's this --hwn) + - Add demerits for quants per se, as to forbid a specific quant entirely - */ + +*/ MAKE_SCHEME_CALLBACK (Beam, quanting, 1); SCM Beam::quanting (SCM smob) @@ -1208,12 +1218,6 @@ Beam::forced_stem_count (Grob *me) -/* - -TODO: -use filter and standard list functions. - -*/ int Beam::visible_stem_count (Grob *me) { @@ -1332,3 +1336,11 @@ Beam::has_interface (Grob *me) return me->has_interface (ly_symbol2scm ("beam-interface")); } + +ADD_INTERFACE (Beam, "beam-interface", + "A beam. + +#'thickness= weight of beams, in staffspace + ", + "concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness"); + diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 243accda39..2b4c510dad 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -100,7 +100,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf) if (!align_l_) { align_l_ = new Item (get_property ("BreakAlignment")); - Break_align_interface::set_interface (align_l_); + announce_grob (align_l_, SCM_EOL); Item * edge = new Item (get_property ("LeftEdge")); @@ -127,9 +127,6 @@ Break_align_engraver::add_to_group(SCM align_name, Item*item_l) { group = new Item (get_property ("BreakAlignGroup")); - Axis_group_interface::set_interface (group); - Axis_group_interface::set_axes (group, X_AXIS,X_AXIS); - group->set_grob_property ("break-align-symbol", align_name); group->set_parent (align_l_, Y_AXIS); announce_grob(group, item_l->self_scm()); diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index 3a7e953811..fd2ae3e9f5 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -67,13 +67,6 @@ Break_align_interface::add_element (Grob*me, Grob *toadd) Axis_group_interface::add_element (me, toadd); } -void -Break_align_interface::set_interface (Grob*me) -{ - Align_interface::set_interface (me); - Align_interface::set_axis (me,X_AXIS); -} - void Break_align_interface::do_alignment (Grob *me) { @@ -92,7 +85,7 @@ Break_align_interface::do_alignment (Grob *me) int idx = 0; - while (extents[idx].empty_b ()) + while (idx < extents.size () && extents[idx].empty_b ()) idx++; Array offsets; @@ -222,3 +215,26 @@ Break_align_interface::do_alignment (Grob *me) } + +ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface", + "Items that are aligned in prefatory matter. + +The spacing of these items is controlled by the space-alist +property. It contains a list break-align-symbols with a specification +of the associated space. The space definition is either (extra-space +. @var{number}), which adds space after the symbol, (minimum-space +. @var{ms}), which pads the space until it it is @var{ms}. + + +Special keys for the alist are 'first-note and 'next-note, signifyign +the first note on a line, and the next note halfway a line. + +", + "break-align-symbol break-alignment-done space-alist"); + +ADD_INTERFACE (Break_align_interface, "break-alignment-interface", + "See @ref{break-aligned-interface}.", + "break-alignment-done"); + + + diff --git a/lily/breathing-sign-engraver.cc b/lily/breathing-sign-engraver.cc index 439e09bee3..18a7491bb1 100644 --- a/lily/breathing-sign-engraver.cc +++ b/lily/breathing-sign-engraver.cc @@ -63,8 +63,6 @@ Breathing_sign_engraver::create_grobs () SCM b = get_property ("BreathingSign"); breathing_sign_p_ = new Item (b); - Breathing_sign::set_interface (breathing_sign_p_); - announce_grob(breathing_sign_p_, breathing_sign_req_l_->self_scm()); breathing_sign_req_l_ = 0; } diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 32ef10e334..85a17b450f 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -52,9 +52,7 @@ Breathing_sign::offset_callback (SCM element_smob, SCM) return gh_double2scm (inter_f * sz * d); } -void -Breathing_sign::set_interface (Grob *b) -{ - Staff_symbol_referencer::set_interface (b); -} +ADD_INTERFACE(Breathing_sign, "breathing-sign-interface", + "A breathing sign.", + "direction"); diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 4ddf833c21..e00f05ace9 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -61,3 +61,9 @@ Chord_name::brew_molecule (SCM smob) return mol.smobbed_copy (); } + + +ADD_INTERFACE (Chord_name, "chord-name-interface", + "generate a chord name", + "pitches chord inversion bass begin-of-line-visible"); + diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 04e156f2a4..99711b84af 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -120,10 +120,8 @@ Chord_tremolo_engraver::process_music () if (flags) { stem_tremolo_ = new Item (get_property ("StemTremolo")); - Stem_tremolo::set_interface (stem_tremolo_); - announce_grob(stem_tremolo_, repeat_->self_scm()); - stem_tremolo_->set_grob_property ("tremolo-flags", + stem_tremolo_->set_grob_property ("flag-count", gh_int2scm (flags)); } diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 3edf26597d..b3ec806aec 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -94,8 +94,6 @@ Clef_engraver::create_clef () Item *c= new Item (get_property ("Clef")); announce_grob(c, SCM_EOL); - Staff_symbol_referencer::set_interface (c); - clef_p_ = c; } SCM cpos = get_property ("clefPosition"); diff --git a/lily/clef.cc b/lily/clef.cc index cbae180159..589ca0856e 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -53,11 +53,6 @@ Clef::has_interface (Grob* me) } -void -Clef::set_interface (Grob* me) -{ - me->set_interface (ly_symbol2scm ("clef-interface")); -} MAKE_SCHEME_CALLBACK (Clef,brew_molecule,1) SCM @@ -74,3 +69,9 @@ Clef::brew_molecule (SCM smob) return SCM_EOL; } } + + +ADD_INTERFACE (Clef, "clef-interface", + "A clef sign", + "non-default full-size-change glyph-name"); + diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index ff947053d2..2b8c4923fe 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -36,9 +36,6 @@ Collision_engraver::create_grobs () if (!col_p_) { col_p_ = new Item (get_property ("NoteCollision")); - Axis_group_interface::set_interface (col_p_); - Axis_group_interface::set_axes (col_p_, X_AXIS, Y_AXIS); - announce_grob (col_p_, SCM_EOL); } diff --git a/lily/collision.cc b/lily/collision.cc index 7a82e12193..ee4b039f13 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -374,3 +374,10 @@ Collision::add_column (Grob*me,Grob* ncol_l) Axis_group_interface::add_element (me, ncol_l); me->add_dependency (ncol_l); } + + +ADD_INTERFACE (Collision, "note-collision-interface", + "An object that handles collisions between notes with different +stem directions and horizontal shifts. Most of the interesting +properties are to be set in @ref{note-column-interface}", + "merge-differently-dotted note-width collision-done"); diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index 8c7db7b92c..ebfa26a947 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -195,8 +195,6 @@ Completion_heads_engraver::process_music () { Item *note_p = new Item (get_property ("NoteHead")); - Staff_symbol_referencer::set_interface (note_p); - Music * req = note_req_l_arr_[i]; if (scratch_note_reqs_.size()) { diff --git a/lily/custos.cc b/lily/custos.cc index 29c32f6996..5fc7266b18 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -9,7 +9,6 @@ /* TODO: - merge create_ledger_line () and Note_head::create_ledger_line () - - rewrite create_ledger_line () to support short and thin ledger lines @@ -146,6 +145,12 @@ Custos::brew_molecule (SCM smob) if (gh_symbol_p (scm_style)) { String style = ly_scm2string (scm_symbol_to_string (scm_style)); + + /* + DOCME: + + Why would we want it differently? What's the meaning of adjust ? + */ bool adjust = to_boolean (me->get_grob_property ("adjust-if-on-staffline")); @@ -207,3 +212,20 @@ Custos::has_interface (Grob*m) { return m && m->has_interface (ly_symbol2scm ("custos-interface")); } + + +ADD_INTERFACE (Custos, "custos-interface", + "A custos is a staff context symbol that appears at the end of a + staff line with monophonic musical contents (i.e. with a single + voice). It anticipates the pitch of the first note of the following + line and thus helps the player or singer to manage line breaks + during performance, thus enhancing readability of a score. + + Custodes were frequently used in music notation until the 16th + century. There were different appearences for different notation + styles. Nowadays, they have survived only in special forms of + musical notation such as via the editio vaticana dating back to the + beginning of the 20th century. + +[TODO: add to glossary]", + "style adjust-if-on-staffline neutral-position"); diff --git a/lily/dot-column.cc b/lily/dot-column.cc index a91ffc5f8f..584b3616e6 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -16,6 +16,10 @@ #include "axis-group-interface.hh" #include "stem.hh" +/* + TODO: let Dot_column communicate with stem via Note_column. + */ + MAKE_SCHEME_CALLBACK (Dot_column,force_shift_callback,2); SCM Dot_column::force_shift_callback (SCM element_smob, SCM axis) @@ -141,3 +145,10 @@ Dot_column::add_head (Grob * me, Grob *rh) } } + + + +ADD_INTERFACE (Dot_column, "dot-column-interface", + "Interface that groups dots so they form a column", + "stem"); + diff --git a/lily/dots.cc b/lily/dots.cc index 1805de4cd1..0e1b6912a7 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -70,3 +70,11 @@ Dots::brew_molecule (SCM d) + +ADD_INTERFACE (Dots, "dots-interface", + "The dots to go with a notehead/rest. A separate interface, since they +are a party in collision resolution. +#'direction is the Direction to handle staff-line collisions in.", + "direction dot-count"); + + diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index fd92417cbc..7ddff09e1f 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -139,8 +139,6 @@ Dynamic_engraver::process_music () line_spanner_ = new Spanner (get_property ("DynamicLineSpanner")); Side_position_interface::set_axis (line_spanner_, Y_AXIS); - Axis_group_interface::set_interface (line_spanner_); - Axis_group_interface::set_axes (line_spanner_, Y_AXIS, Y_AXIS); Music * rq = accepted_spanreqs_drul_[START]; if (script_req_l_) @@ -172,8 +170,6 @@ Dynamic_engraver::process_music () script_p_->set_grob_property ("text", script_req_l_->get_mus_property ("text")); - Side_position_interface::set_direction (script_p_, DOWN); - if (Direction d = script_req_l_->get_direction ()) Directional_element_interface::set (line_spanner_, d); @@ -250,9 +246,7 @@ Dynamic_engraver::process_music () else { cresc_p_ = new Spanner (get_property ("TextSpanner")); - cresc_p_->set_interface (ly_symbol2scm ("dynamic-interface")); cresc_p_->set_grob_property ("type", s); - daddy_trans_l_->set_property ((start_type + "Spanner").ch_C(), SCM_UNDEFINED); s = get_property ((start_type + "Text").ch_C ()); diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 03b268ea76..c07095e9c1 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -35,17 +35,17 @@ Engraver_group_engraver::create_grobs_in_simple_children () /* - '''Done: eliminating useless broadcast/acknowledge''' + Done: eliminating useless broadcast/acknowledge One cause for translation slowness: grob broadcasted/acknowledges -(b/a): every grob is b/a'd to all peer-engravers and all + (b/a): every grob is b/a-ed to all peer-engravers and all parent-engravers. This means that lots of (often) useless b/a is done for large scores (the top-level engravers gets to know every detail of every voice, thread, etc. Measurements indicate this is 10% of the -interpretation time: + interpretation time: -standchen + standchen old: (pre 1.5.13) 10.28 new: 8.73 @@ -64,7 +64,7 @@ The cost of precomputing engraver lists has two elts: computing the list itself, GC for the structure, looking up the list during the acks. - */ +*/ SCM find_acknowledge_engravers (SCM gravlist, SCM meta); void Engraver_group_engraver::acknowledge_grobs () diff --git a/lily/figured-bass-engraver.cc b/lily/figured-bass-engraver.cc index 9e97d0e018..c725f77f48 100644 --- a/lily/figured-bass-engraver.cc +++ b/lily/figured-bass-engraver.cc @@ -78,7 +78,7 @@ Figured_bass_engraver::process_music () ENTER_DESCRIPTION(Figured_bass_engraver, -/* descr */ "Make volta brackets", +/* descr */ "Make figured bass numbers.", /* creats*/ "BassFigure", /* acks */ "", /* reads */ "", diff --git a/lily/font-interface.cc b/lily/font-interface.cc index c5c32c2337..09275dc19d 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -237,3 +237,9 @@ Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain) return ly_str02scm ("cmr10"); } + + + +ADD_INTERFACE (Font_interface, "font-interface", + "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)", + "font-magnification font-style font font-series font-shape font-family font-name font-design-size font-relative-size"); diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc new file mode 100644 index 0000000000..dd1b1e9409 --- /dev/null +++ b/lily/grob-interface.cc @@ -0,0 +1,87 @@ +#include "protected-scm.hh" +#include "grob-interface.hh" +#include "lily-guile.hh" +#include "grob.hh" +#include "warn.hh" + +Protected_scm all_ifaces; + + +void add_interface (const char * symbol, + const char * descr, + const char * vars) +{ + SCM s = ly_symbol2scm (symbol); + SCM d = gh_str02scm (descr); + SCM l = parse_symbol_list (vars); + + + ly_add_interface(s,d,l); +} + +SCM +ly_add_interface (SCM a, SCM b, SCM c) +{ + SCM_ASSERT_TYPE (gh_symbol_p(a), a, SCM_ARG1, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (gh_string_p(b), b, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (gh_list_p(c), c, SCM_ARG3, __FUNCTION__, "list of syms"); + if (!gh_vector_p (all_ifaces)) + { + all_ifaces = scm_make_vector (gh_int2scm (40), SCM_EOL); + } + + SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED); + + scm_hashq_set_x (all_ifaces, a, entry); + + + return SCM_UNSPECIFIED; +} + + +SCM +ly_all_grob_interfaces () +{ + return all_ifaces; +} + +void +init_iface_funcs () +{ + scm_c_define_gsubr ("ly-add-interface", 3, 0, 0, + (Scheme_function_unknown)ly_add_interface); + scm_c_define_gsubr ("ly-all-grob-interfaces", 0, 0, 0, + (Scheme_function_unknown)ly_all_grob_interfaces); +} + +ADD_SCM_INIT_FUNC(giface, init_iface_funcs); + +void +check_interfaces_for_property (Grob *me, SCM sym) +{ + SCM ifs = me->get_grob_property ("interfaces"); + + + bool found = false; + for (; !found && gh_pair_p (ifs); ifs =gh_cdr (ifs)) + { + SCM iface = scm_hashq_ref (all_ifaces , gh_car (ifs), SCM_BOOL_F); + if (iface == SCM_BOOL_F) + { + String msg = to_str ("Unknown interface `%s'", + ly_scm2string (scm_symbol_to_string (gh_car(ifs))).ch_C()); + programming_error (msg); + continue; + } + + found= found || (scm_memq (sym, gh_caddr (iface)) != SCM_BOOL_F); + } + + if (!found) + { + String str = to_str("Grob %s has no interface for property %s", + me->name ().ch_C(), + ly_symbol2string(sym).ch_C()); + programming_error (str); + } +} diff --git a/lily/grob.cc b/lily/grob.cc index 9484c6951a..7daa21f1d4 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -85,7 +85,10 @@ Grob::Grob (SCM basicprops) /* Should change default to be empty? */ - if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb)) + if (cb != SCM_BOOL_F + && !gh_procedure_p (cb) && !gh_pair_p (cb) + && gh_procedure_p (get_grob_property ("molecule-callback")) + ) cb = molecule_extent_proc; dim_cache_[a].dimension_ = cb; @@ -95,8 +98,13 @@ Grob::Grob (SCM basicprops) if (gh_pair_p (meta)) { SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta); - - set_grob_property ("interfaces",ly_cdr (ifs)); + + /* + do it directly to bypass interface checks. + */ + mutable_property_alist_ = gh_cons (gh_cons (ly_symbol2scm ("interfaces"), + gh_cdr (ifs)), + mutable_property_alist_); } } @@ -168,12 +176,17 @@ Grob::set_immutable_grob_property (SCM s, SCM v) } #endif +extern void check_interfaces_for_property (Grob *me, SCM sym); + void Grob::internal_set_grob_property (SCM s, SCM v) { #ifndef NDEBUG if (internal_type_checking_global_b) - assert (type_check_assignment (s, v, ly_symbol2scm ("backend-type?"))); + { + assert (type_check_assignment (s, v, ly_symbol2scm ("backend-type?"))); + check_interfaces_for_property(this, s); + } #endif @@ -261,6 +274,12 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname) Molecule * Grob::get_molecule () const { + if (immutable_property_alist_ == SCM_EOL) + { + return 0; + + } + SCM mol = get_grob_property ("molecule"); if (unsmob_molecule (mol)) return unsmob_molecule (mol); @@ -394,12 +413,15 @@ Grob::handle_broken_grobs (SCM src, SCM criterion) /* now: sc && sc->line_l () == line */ if (!line) return sc->self_scm(); - /* - This was introduced in 1.3.49 as a measure to prevent - programming errors. It looks expensive (?). TODO: - benchmark , document when (what kind of programming - errors) this happens. - */ + /* + This was introduced in 1.3.49 as a measure to prevent + programming errors. It looks expensive (?). + + TODO: + + benchmark , document when (what kind of programming + errors) this happens. + */ if (sc->common_refpoint (line, X_AXIS) && sc->common_refpoint (line, Y_AXIS)) { @@ -583,13 +605,6 @@ Grob::empty_b (Axis a)const gh_procedure_p (dim_cache_[a].dimension_)); } -/* - TODO: add - - Grob *refpoint - - to arguments? - */ Interval Grob::extent (Grob * refp, Axis a) const { @@ -935,18 +950,14 @@ Grob::has_interface (SCM k) return scm_memq (k, ifs) != SCM_BOOL_F; } -void -Grob::set_interface (SCM k) -{ - if (has_interface (k)) - return ; - else - { - set_grob_property ("interfaces", - gh_cons (k, get_grob_property ("interfaces"))); - } -} - ADD_SCM_INIT_FUNC (scoreelt, init_functions); IMPLEMENT_TYPE_P (Grob, "ly-grob?"); + +ADD_INTERFACE (Grob, "grob-interface", + "All grobs support this", + "X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause +Y-extent-callback molecule-callback font-relative-size extra-offset +staff-symbol interfaces dependencies no-spacing-rods extra-extent-X causes +layer extra-extent-Y minimum-extent-X minimum-extent-Y transparent"); + diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 26518b007f..f1c715d602 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -140,3 +140,11 @@ Hairpin::brew_molecule (SCM smob) +ADD_INTERFACE (Hairpin, "hairpin-interface", + "hairpin crescendo. + +padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf' + +", + "grow-direction thickness height padding"); + diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index a8a2d938ae..3ddad25c62 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -82,11 +82,6 @@ Hara_kiri_group_spanner::add_element (Grob * me, Grob *e) } -void -Hara_kiri_group_spanner::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("hara-kiri-group-interface")); -} bool @@ -101,3 +96,12 @@ Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n) me->add_dependency (n); Pointer_group_interface::add_grob (me, ly_symbol2scm ("items-worth-living"),n); } + + +ADD_INTERFACE (Hara_kiri_group_spanner,"hara-kiri-group-interface", + " As Vertical_group_spanner, but keep track of interesting items. If +we don't contain any interesting items after linebreaking, then +gracefully commit suicide. Objective: don't disgrace Lily by +typesetting empty lines in orchestral scores.", + "items-worth-living"); + diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index 6b42b5b554..ce66513274 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -114,3 +114,11 @@ Hyphen_spanner::Hyphen_spanner (Spanner*s) elt_l_ = s; } + + +ADD_INTERFACE (Hyphen_spanner, "lyric-hyphen-interface", + "A centred hyphen is a simple line between lyrics used to divide +syllables. The length of the hyphen line should stretch based on the +size of the gap between syllables.", + "thickness height minimum-length maximum-length word-space"); + diff --git a/lily/include/grob-interface.hh b/lily/include/grob-interface.hh new file mode 100644 index 0000000000..028c4763f6 --- /dev/null +++ b/lily/include/grob-interface.hh @@ -0,0 +1,28 @@ +/* + interface.hh -- declare Interface + + source file of the GNU LilyPond music typesetter + + (c) 2002 Han-Wen Nienhuys + + */ + +#ifndef INTERFACE_HH +#define INTERFACE_HH + + +void add_interface (const char * symbol, + const char * descr, + const char * vars); + +SCM ly_add_interface (SCM, SCM, SCM); + +#define ADD_INTERFACE(cl,a,b,c) \ +void cl ## _init_ifaces() {\ + add_interface(a,b,c);\ +}\ +ADD_SCM_INIT_FUNC(cl ## ifaces, cl ## _init_ifaces);\ + + +#endif /* INTERFACE_HH */ + diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 028f5a14b7..f94e388712 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -13,6 +13,7 @@ #include "lily-proto.hh" #include "smobs.hh" #include "dimension-cache.hh" +#include "grob-interface.hh" /** for administration of what was done already @@ -125,7 +126,6 @@ public: static SCM ly_get_grob_property (SCM, SCM); bool has_interface (SCM intf); - void set_interface (SCM intf); virtual void handle_broken_dependencies (); virtual void handle_prebroken_dependencies (); diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index 2aa5ffcf5b..42b5a0da1c 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -20,7 +20,6 @@ public: DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob, SCM axis)); DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_parent_callback, (SCM ,SCM)); static void add_element (Grob *me, Grob *e); - static void set_interface (Grob*me); static bool has_interface (Grob*); static void consider_suicide (Grob*me); static void add_interesting_item (Grob * me , Grob* n); diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index e250a6a7ef..329d08cefa 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -144,7 +144,6 @@ class Rest_req; class Rhythmic_req; class Scaled_font_metric; class Scheme_hash_table; -class Scope; class Score; class Grob; class Score_engraver; diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index 8015d60790..54b8954c53 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -18,10 +18,6 @@ /** Definition of how to output lilypond. - - TODO: smobify, remove Music_output_def_identifier. - - TODO: remove Scope structure. Scheme_hash_table has all the info. */ class Music_output_def { @@ -29,8 +25,6 @@ public: Scheme_hash_table * translator_tab_; Scheme_hash_table * variable_tab_; - Scope *translator_p_dict_p_; - Scope *scope_p_; SCM scaled_fonts_; SCM style_sheet_; diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index 19723a0c45..c15ac41ff5 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -19,7 +19,7 @@ class Music_output { public: - Scope * header_l_; + Scheme_hash_table * header_l_; String default_out_str_; String origin_str_; int errorlevel_i_; diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index 9868a3f686..40701e2355 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -32,8 +32,6 @@ public: String main_input_str_; void * lexval_l; Scheme_hash_table * toplevel_variable_tab_; - Scope * scope_p_; - bool main_input_b_; /* @@ -42,7 +40,7 @@ public: Protected_scm chordmodifier_tab_; Protected_scm pitchname_tab_; - Link_array scope_l_arr_; + Link_array scope_l_arr_; Keyword_table * keytable_p_; int errorlevel_i_; @@ -61,7 +59,7 @@ public: void push_lyric_state (); void pop_state (); void LexerError (char const *); - void set_identifier (String str, SCM); + void set_identifier (SCM name_str, SCM); bool note_state_b () const; bool chord_state_b () const; bool lyric_state_b () const; diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index ddb7038294..47b85c5799 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -40,7 +40,7 @@ public: public: Duration default_duration_; - Scope *default_header_p_; + Scheme_hash_table *default_header_p_; int fatal_error_i_; Sources * source_l_; diff --git a/lily/include/note-spacing.hh b/lily/include/note-spacing.hh index 84424f188b..f0c14d0908 100644 --- a/lily/include/note-spacing.hh +++ b/lily/include/note-spacing.hh @@ -18,7 +18,7 @@ public: static bool has_interface (Grob*); static void get_spacing (Grob *me, Item* , Real, Real, Real*, Real*); - static Real stem_dir_correction (Grob *me, Item * next_col); + static Real stem_dir_correction (Grob *me, Item * next_col, Real incr); static Item * right_column (Grob*); static Item * left_column (Grob*); }; diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index bccde18b7f..56defcc3b2 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -43,7 +43,7 @@ public: void output_int_def (String k, int v); void output_Real_def (String k, Real v); void output_String_def (String k, String v); - void output_scope (Scope*, String prefix); + void output_scope (Scheme_hash_table*, String prefix); void output_version (); void output_font_def (int i, String str); void output_font_switch (int i); @@ -53,7 +53,7 @@ public: void output_scheme (SCM scm); void write_header_field_to_file (String filename, SCM, SCM); - void write_header_fields_to_file (Scope *); + void write_header_fields_to_file (Scheme_hash_table *); }; #endif // PAPER_OUTPUTTER_HH diff --git a/lily/include/scope.hh b/lily/include/scope.hh deleted file mode 100644 index adabc40499..0000000000 --- a/lily/include/scope.hh +++ /dev/null @@ -1,41 +0,0 @@ -/* - scope.hh -- declare Scope - - source file of the GNU LilyPond music typesetter - - (c) 1998--2002 Han-Wen Nienhuys - - */ - -#ifndef SCOPE_HH -#define SCOPE_HH - -#include "lily-proto.hh" -#include "lily-guile.hh" - -class Scheme_hash_table; - -/* - Junk this almost-void class. - */ -class Scope { - Scheme_hash_table *id_dict_; - Scope (Scope const &); -public: - SCM to_alist () const; - bool elem_b (String ) const; - bool elem_b (SCM s) const; - - bool try_retrieve (SCM key, SCM *val) const; - - SCM scm_elem (String) const; - SCM scm_elem (SCM) const; - - - void set (String, SCM); - Scope (Scheme_hash_table*); - - friend class Scope_iter; -}; -#endif /* SCOPE_HH */ - diff --git a/lily/include/separation-item.hh b/lily/include/separation-item.hh index 9a64afaf8e..bca937d454 100644 --- a/lily/include/separation-item.hh +++ b/lily/include/separation-item.hh @@ -12,11 +12,8 @@ #include "lily-proto.hh" -/** -*/ struct Separation_item { - static bool has_interface (Grob*); static Interval my_width (Grob*) ; static void add_item (Grob*,Item*); diff --git a/lily/include/spaceable-grob.hh b/lily/include/spaceable-grob.hh index 32679ae2c5..57ed529dea 100644 --- a/lily/include/spaceable-grob.hh +++ b/lily/include/spaceable-grob.hh @@ -18,7 +18,7 @@ struct Spaceable_grob /// set a minimum distance static void add_rod (Grob*me, Grob * to, Real distance); static void add_spring (Grob*me,Grob * to, Real dist, Real strength, bool); - static void set_interface (Grob*); + static void remove_interface (Grob*); static SCM get_minimum_distances (Grob*); static SCM get_ideal_distances (Grob*); diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 65e7d238ab..fcda40ed7b 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -45,8 +45,6 @@ public: DECLARE_SCHEME_CALLBACK (dim_callback, (SCM smob, SCM axis)); DECLARE_SCHEME_CALLBACK (height, (SCM,SCM)); static bool has_interface (Grob*); - static void set_interface (Grob*); - static void set_spacing_hints (Grob*me) ; }; #endif diff --git a/lily/include/tie-column.hh b/lily/include/tie-column.hh index 0d7161e70a..7e41e7efdb 100644 --- a/lily/include/tie-column.hh +++ b/lily/include/tie-column.hh @@ -17,7 +17,6 @@ class Tie_column { public: - static void set_interface (Grob*me); static bool has_interface (Grob*); static void add_tie (Grob*me,Grob*); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); diff --git a/lily/item.cc b/lily/item.cc index 2d161192f6..c40c5adba2 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -14,11 +14,14 @@ #include "spanner.hh" #include "lily-guile.hh" #include "line-of-score.hh" +#include "group-interface.hh" Item::Item (SCM s) : Grob (s) { broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0; + Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("item-interface")); + } /** @@ -192,3 +195,8 @@ unsmob_item (SCM s ) { return dynamic_cast (unsmob_grob (s)); } + +ADD_INTERFACE(Item, + "item-interface", + "", + "visibility-lambda breakable") diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 2c08ae4112..f8387cac5e 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -69,7 +69,6 @@ Key_engraver::create_key (bool def) item_p_->set_grob_property ("old-accidentals", get_property ("lastKeySignature")); item_p_->set_grob_property ("new-accidentals", get_property ("keySignature")); - Staff_symbol_referencer::set_interface (item_p_); announce_grob(item_p_, keyreq_l_ ? keyreq_l_->self_scm() : SCM_EOL); } diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 6375de7100..802a6bf015 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -22,9 +22,6 @@ struct Key_signature_interface { - - static void set_interface (Grob*); - static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); }; @@ -174,9 +171,6 @@ Key_signature_interface::brew_molecule (SCM smob) return mol.smobbed_copy (); } -bool -Key_signature_interface::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("key-signature-interface")); -} - +ADD_INTERFACE (Key_signature_interface, "key-signature-interface", + "A group of accidentals.", + "c0-position old-accidentals new-accidentals"); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 975b9e5229..e2ab82ae2f 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -557,7 +557,9 @@ ly_assoc_cdr (SCM key, SCM alist) } /* - LIST has the form "sym1 sym2 sym3" + LIST has the form "sym1 sym2 sym3\nsym4\nsym5" + + i.e. \n and ' ' can be used interchangeably as separators. */ SCM parse_symbol_list (const char * list) @@ -565,9 +567,18 @@ parse_symbol_list (const char * list) char * s = strdup (list); char *orig = s; SCM create_list = SCM_EOL; + + for (char * p = s; *p; p++) + { + if (*p == '\n') + *p = ' ' ; + } + if (!s[0] ) s = 0; + + while (s) { char *next = strchr (s, ' '); diff --git a/lily/line-group-group-engraver.cc b/lily/line-group-group-engraver.cc deleted file mode 100644 index 0ef6a7d81d..0000000000 --- a/lily/line-group-group-engraver.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - line-group-engraver-group.cc -- implement Line_group_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--2002 Han-Wen Nienhuys -*/ - -#include "command-request.hh" -#include "bar-line.hh" -#include "debug.hh" -#include "line-group-group-engraver.hh" -#include "paper-column.hh" -#include "axis-group-interface.hh" -#include "spanner.hh" - - -Line_group_engraver_group::Line_group_engraver_group () -{ - staffline_p_ =0; -} - - -void -Line_group_engraver_group::typeset_grob (Grob *elem) -{ - if (!elem->get_parent (Y_AXIS)) - Axis_group_interface::add_element (staffline_p_, elem); - Engraver_group_engraver::typeset_grob (elem); -} - - -void -Line_group_engraver_group::finalize () -{ - Engraver_group_engraver::finalize (); - Grob * it - = unsmob_grob (get_property ("currentCommandColumn")); - - staffline_p_->set_bound (RIGHT,it); - Engraver_group_engraver::typeset_grob (staffline_p_); - staffline_p_ = 0; -} - -void -Line_group_engraver_group::initialize () -{ - create_line_spanner (); - Grob * it - = unsmob_grob (get_property ("currentCommandColumn")); - staffline_p_->set_bound (LEFT,it); - - Engraver::announce_grob (staffline_p_, SCM_EOL); -} - -void -Line_group_engraver_group::create_line_spanner () -{ - staffline_p_ = new Spanner (SCM_EOL); - Axis_group_interface::set_interface (staffline_p_); - Axis_group_interface::set_axes (staffline_p_, Y_AXIS,Y_AXIS); -} - -ENTER_DESCRIPTION(Line_group_engraver_group, - "", - "", - "", - "", - ""); - diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 9f8a47b830..3b7c1495b3 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -246,7 +246,7 @@ Line_spanner::brew_molecule (SCM smob) Real thick = me->paper_l ()->get_var ("stafflinethickness"); - SCM s = me->get_grob_property ("line-thickness"); + SCM s = me->get_grob_property ("thickness"); if (gh_number_p (s)) thick *= gh_scm2double (s); @@ -259,3 +259,10 @@ Line_spanner::brew_molecule (SCM smob) } + +ADD_INTERFACE (Line_spanner, "line-spanner-interface", + "Generic line drawn between two objects, eg. for use with glissandi. +gap is measured in staff-spaces. ", + "gap dash-period dash-length thickness type"); + + diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index f2d03d6e4e..5709fb428e 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -69,15 +69,16 @@ Local_key_item::add_pitch (Grob*me, Pitch p, bool cautionary, bool natural, Molecule Local_key_item::parenthesize (Grob*me, Molecule m) { - Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-(")); - Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-)")); + Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-leftparen")); + Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-rightparen")); m.add_at_edge (X_AXIS, LEFT, Molecule (open), 0); m.add_at_edge (X_AXIS, RIGHT, Molecule (close), 0); return m; } -/* HW says: maybe move to tie.cc +/* + HW says: maybe move to tie.cc Note, tie should not kill all accidentals when broken, only the ones that are indicated by a property tie-break-reminder, I guess @@ -248,8 +249,9 @@ Local_key_item::has_interface (Grob*m) { return m && m->has_interface (ly_symbol2scm ("accidentals-interface")); } -void -Local_key_item::set_interface (Grob*m) -{ - m->set_interface (ly_symbol2scm ("accidentals-interface")); -} + + + +ADD_INTERFACE (Local_key_item, "accidentals-interface", + "Accidentals", + "accidentals left-padding right-padding paren-cautionaries cautionary-size"); diff --git a/lily/lookup.cc b/lily/lookup.cc index 8e5c17eb89..1a2c793082 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -445,10 +445,6 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) return m; } -/* - TODO: should use slope instead? Angle gives nasty rad <-> degree - conversions. -*/ Molecule Lookup::repeat_slash (Real w, Real s, Real t) { diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 9fc7f8a7a4..38c44068cd 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -54,3 +54,9 @@ Lyric_extender::set_textitem (Spanner*sp, Direction d, Grob*s) } + + +ADD_INTERFACE (Lyric_extender,"lyric-extender-interface", + "The extender is a simple line at the baseline of the lyric +that helps show the length of a melissima (tied/slurred note).", + "word-space height right-trim-amount"); diff --git a/lily/midi-def.cc b/lily/midi-def.cc index 5d76f00341..2f2479815d 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -11,7 +11,7 @@ #include "midi-def.hh" #include "performance.hh" #include "debug.hh" -#include "scope.hh" +#include "scm-hash.hh" Midi_def::Midi_def () { @@ -23,7 +23,7 @@ int Midi_def::get_tempo_i (Moment one_beat_mom) { SCM wis = ly_symbol2scm ("whole-in-seconds"); - Moment *w = unsmob_moment (scope_p_->scm_elem (wis)); + Moment *w = unsmob_moment (variable_tab_->get (wis)); Moment wholes_per_min = Moment (60); if (!w) @@ -46,7 +46,7 @@ Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i) Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60); Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom); - scope_p_->set ("whole-in-seconds", m.smobbed_copy ()); + variable_tab_->set (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ()); } diff --git a/lily/molecule.cc b/lily/molecule.cc index 4efdcfaf1d..e45bddbcae 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -202,11 +202,11 @@ ly_add_molecule (SCM first, SCM second) SCM -make_molecule (SCM expr, SCM xext, SCM yext) +ly_make_molecule (SCM expr, SCM xext, SCM yext) { - /* - TODO: typechecking. - */ + SCM_ASSERT_TYPE (ly_number_pair_p (xext), xext, SCM_ARG2, __FUNCTION__, "number pair"); + SCM_ASSERT_TYPE (ly_number_pair_p (yext), yext, SCM_ARG3, __FUNCTION__, "number pair"); + Box b (ly_scm2interval (xext), ly_scm2interval(yext)); Molecule m (b, expr); return m.smobbed_copy (); @@ -246,7 +246,7 @@ ly_align_to_x (SCM mol, SCM axis, SCM dir) static void molecule_init () { - scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) make_molecule); + scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) ly_make_molecule); scm_c_define_gsubr ("ly-fontify-atom", 2, 0, 0, (Scheme_function_unknown) ly_fontify_atom); scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x); scm_c_define_gsubr ("ly-add-molecule", 2, 0,0,(Scheme_function_unknown) ly_add_molecule); diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index ba7cdafbc7..4f1115a98a 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -100,9 +100,6 @@ Multi_measure_rest_engraver::process_music () { mmrest_p_ = new Spanner (get_property ("MultiMeasureRest")); - Multi_measure_rest::set_interface (mmrest_p_); - Staff_symbol_referencer::set_interface (mmrest_p_); - announce_grob(mmrest_p_, busy_span_req_l_->self_scm()); start_measure_i_ = gh_scm2int (get_property ("currentBarNumber")); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index ed39337b78..d7f6f04144 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -21,13 +21,6 @@ #include "text-item.hh" #include "percent-repeat-item.hh" - -void -Multi_measure_rest::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("multi-measure-rest-interface")); -} - bool Multi_measure_rest::has_interface (Grob*me) { @@ -273,3 +266,13 @@ Multi_measure_rest::set_spacing_rods (SCM smob) return SCM_UNSPECIFIED; } + + +ADD_INTERFACE (Multi_measure_rest,"multi-measure-rest-interface", + "A rest that spans a whole number of measures. For typesetting the +numbers, fields from font-interface may be used. + +padding is the space between number and rest. Measured in staffspace. + +", + "columns measure-count expand-limit minimum-width padding"); diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 10d883e24a..f2f3195b6e 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -9,7 +9,6 @@ #include "scm-hash.hh" #include "dictionary.hh" -#include "scope.hh" #include "debug.hh" #include "music-output-def.hh" #include "global-translator.hh" @@ -33,8 +32,6 @@ Music_output_def::Music_output_def () variable_tab_ = new Scheme_hash_table; translator_tab_ = new Scheme_hash_table; - scope_p_ = new Scope (variable_tab_); - translator_p_dict_p_ = new Scope (translator_tab_); smobify_self (); scm_gc_unprotect_object (variable_tab_->self_scm ()); @@ -52,13 +49,10 @@ Music_output_def::Music_output_def (Music_output_def const &s) style_sheet_ = SCM_EOL; scaled_fonts_ = SCM_EOL; + smobify_self (); scm_gc_unprotect_object (variable_tab_->self_scm ()); scm_gc_unprotect_object (translator_tab_->self_scm ()); - - - scope_p_ = new Scope (variable_tab_); - translator_p_dict_p_ = new Scope (translator_tab_); style_sheet_ = scm_list_copy (s.style_sheet_); scaled_fonts_ = scm_list_copy (s.scaled_fonts_); @@ -87,11 +81,11 @@ Music_output_def::assign_translator (SCM transdef) assert (tp); - String s; + SCM s = ly_symbol2scm (""); if (gh_string_p (tp->type_name_)) - s = ly_scm2string (tp->type_name_); + s = scm_string_to_symbol (tp->type_name_); - translator_p_dict_p_->set (s, transdef); + translator_tab_->set (s, transdef); } /* diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 767ebf54a2..59e8d2f4a3 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -20,7 +20,6 @@ #include "debug.hh" #include "source-file.hh" #include "main.hh" -#include "scope.hh" #include "input.hh" #include "moment.hh" @@ -97,9 +96,7 @@ My_lily_lexer::My_lily_lexer () { keytable_p_ = new Keyword_table (the_key_tab); toplevel_variable_tab_ = new Scheme_hash_table ; - scope_p_ = new Scope (toplevel_variable_tab_); - - scope_l_arr_.push (scope_p_); + scope_l_arr_.push (toplevel_variable_tab_); errorlevel_i_ = 0; main_input_b_ = false; @@ -133,21 +130,25 @@ My_lily_lexer::start_main_input () } void -My_lily_lexer::set_identifier (String name_str, SCM s) +My_lily_lexer::set_identifier (SCM name, SCM s) { - if (lookup_keyword (name_str) >= 0) + assert (gh_string_p (name)); + + if (lookup_keyword (ly_scm2string (name)) >= 0) { - warning (_f ("Identifier name is a keyword: `%s'", name_str)); + size_t sz; + char * str = gh_scm2newstr (name, &sz) ; + warning (_f ("Identifier name is a keyword: `%s'", str)); + free (str); } - scope_l_arr_.top ()->set (name_str, s); + scope_l_arr_.top ()->set (scm_string_to_symbol (name), s); } My_lily_lexer::~My_lily_lexer () { delete keytable_p_; scm_gc_unprotect_object (toplevel_variable_tab_->self_scm ()); - delete scope_p_ ; } diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index 730a6db343..ff1baa3642 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -13,7 +13,7 @@ #include "main.hh" #include "parser.hh" #include "file-results.hh" -#include "scope.hh" +#include "scm-hash.hh" My_lily_parser::My_lily_parser (Sources * source_l) { @@ -29,7 +29,8 @@ My_lily_parser::My_lily_parser (Sources * source_l) My_lily_parser::~My_lily_parser () { delete lexer_p_; - delete default_header_p_; + if (default_header_p_) + scm_gc_unprotect_object (default_header_p_->self_scm()); } void @@ -113,7 +114,7 @@ My_lily_parser::paper_description () Music_output_def *id = unsmob_music_output_def (me->lexer_p_->lookup_identifier ("$defaultpaper")); Paper_def *p = dynamic_cast (id->clone ()); - SCM al = p->translator_p_dict_p_->to_alist (); + SCM al = p->translator_tab_->to_alist (); SCM l = SCM_EOL; for (SCM s = al ; gh_pair_p (s); s = ly_cdr (s)) { diff --git a/lily/note-column.cc b/lily/note-column.cc index b53a18deb4..d35b6da16f 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -34,15 +34,6 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2) return h1 - h2; } -void -Note_column::set_interface (Grob* me) -{ - me->set_interface (ly_symbol2scm ("note-column-interface")); - - Axis_group_interface::set_interface (me); - Axis_group_interface::set_axes (me, X_AXIS, Y_AXIS); -} - Item * Note_column::stem_l (Grob*me) { @@ -158,3 +149,10 @@ Note_column::accidentals (Grob *me) return 0; } + + + +ADD_INTERFACE (Note_column,"note-column-interface", + "Stem and noteheads combined", + "arpeggio note-heads rest-collision rest horizontal-shift stem accidentals force-hshift"); + diff --git a/lily/note-head.cc b/lily/note-head.cc index a1764e8796..b66b61d77c 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -170,7 +170,7 @@ internal_brew_molecule (Grob *me, bool ledger_take_space) */ left_ledger_protusion *= 0.66; - right_ledger_protusion *= 0.8; + right_ledger_protusion *= 0.9; } Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion, @@ -276,3 +276,8 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a) return gh_number_p (result) ? gh_scm2double (result) : 0.0; } + +ADD_INTERFACE (Note_head,"note-head-interface", + "Note head", + "accidentals-grob style stem-attachment-function"); + diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 30dffc105e..23ded7abd5 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -65,8 +65,6 @@ Note_heads_engraver::process_music () { Item *note_p = new Item (get_property ("NoteHead")); - Staff_symbol_referencer::set_interface (note_p); - Music * req = note_req_l_arr_[i]; Duration dur = *unsmob_duration (req->get_mus_property ("duration")); diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 8f29e28dd1..a002d50dc2 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -44,12 +44,22 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, { it = it -> find_prebroken_piece (col_dir); } + /* some kind of mismatch, eg. a note column, that is behind a linebreak. */ if (!it) continue; + + if (d == RIGHT && right_col != it->column_l ()) + continue; + + if (Separation_item::has_interface (it)) + { + extents[d].unite (Separation_item::my_width (it)); + continue; + } extents[d].unite (it->extent (it->column_l (), X_AXIS)); if (d == RIGHT) @@ -84,7 +94,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, *space += 0.5 * (( -extents[RIGHT][LEFT]) >? 0); } - *space += stem_dir_correction (me, right_col); + *space += stem_dir_correction (me, right_col, increment); } Item * @@ -167,12 +177,10 @@ Note_spacing::right_column (Grob*me) TODO: have to check wether the stems are in the same staff. - TODO: also correct for bar lines in RIGHT-ITEMS. Should check if - the barline is the leftmost object of the break alignment. - */ Real -Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn) +Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn, + Real increment) { Drul_array stem_dirs(CENTER,CENTER); Drul_array stem_posns; @@ -180,6 +188,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn) Drul_array props(me->get_grob_property ("left-items"), me->get_grob_property ("right-items")); + Drul_array beams_drul(0,0); Real correction = 0.0; stem_dirs[LEFT] = stem_dirs[RIGHT] = CENTER; @@ -228,6 +237,9 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn) goto exit_func ; } + beams_drul[d] = Stem::beam_l (stem); + + Direction sd = Stem::get_direction (stem); if (stem_dirs[d] && stem_dirs[d] != sd) { @@ -262,27 +274,40 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn) if (correct &&stem_dirs[LEFT] *stem_dirs[RIGHT] == -1) { - - intersect = stem_posns[LEFT]; - intersect.intersect(stem_posns[RIGHT]); - correct = correct && !intersect.empty_b (); + if (beams_drul[LEFT] == beams_drul[RIGHT]) + { + /* + this is a knee: maximal correction. + */ + + correction = increment* stem_dirs[LEFT]; + } + else + { + intersect = stem_posns[LEFT]; + intersect.intersect(stem_posns[RIGHT]); + correct = correct && !intersect.empty_b (); - if (!correct) - return 0.0; - /* - Ugh. 7 is hardcoded. - */ - correction = abs (intersect.length ()); - correction = (correction/7) get_grob_property ("stem-spacing-correction")); + if (!correct) + return 0.0; + + correction = abs (intersect.length ()); - if (!bar_yextent.empty_b()) - { - correction *= 0.5; + + /* + Ugh. 7 is hardcoded. + */ + correction = (correction/7) get_grob_property ("stem-spacing-correction")); + + if (!bar_yextent.empty_b()) + { + correction *= 0.5; + } } } - else if (correct) + else if (correct && stem_dirs[LEFT] *stem_dirs[RIGHT] == UP) { /* Correct for the following situation: @@ -326,3 +351,10 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn) return correction; } + + + +ADD_INTERFACE (Note_spacing,"note-spacing-interface", + "", + "left-items right-items stem-spacing-correction"); + diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 3f7d17a400..c474e92af5 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -60,10 +60,6 @@ Paper_column::column_l () const Paper_column::Paper_column (SCM l) : Item (l) // guh.? { - Axis_group_interface::set_interface (this); - Axis_group_interface::set_axes (this, X_AXIS, X_AXIS); - Spaceable_grob::set_interface (this); - line_l_=0; rank_i_ = -1; } @@ -127,3 +123,9 @@ Paper_column::brew_molecule (SCM p) return t.smobbed_copy (); } + + + +ADD_INTERFACE (Paper_column, "paper-column-interface", + "", + "between-cols when bounded-by-me shortest-playing-duration shortest-starter-duration"); diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 03766359ef..f051844532 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -15,7 +15,7 @@ #include "debug.hh" #include "scaled-font-metric.hh" #include "main.hh" -#include "scope.hh" +#include "scm-hash.hh" #include "file-results.hh" // urg? header_global_p #include "paper-outputter.hh" @@ -48,7 +48,7 @@ Paper_def::get_var (String s) const SCM Paper_def::get_scmvar (String s) const { - return scope_p_->scm_elem (ly_symbol2scm (s.ch_C ())); + return variable_tab_->get (ly_symbol2scm (s.ch_C ())); } @@ -62,7 +62,7 @@ Real Paper_def::get_realvar (SCM s) const { SCM val ; - if (!scope_p_->try_retrieve (s, &val)) + if (!variable_tab_->try_retrieve (s, &val)) { programming_error ("unknown paper variable: " + ly_symbol2string (s)); return 0.0; @@ -70,7 +70,7 @@ Paper_def::get_realvar (SCM s) const Real sc = 1.0; SCM ssc; - if (scope_p_->try_retrieve (ly_symbol2scm ("outputscale"), &ssc)) + if (variable_tab_->try_retrieve (ly_symbol2scm ("outputscale"), &ssc)) { sc = gh_scm2double (ssc); } @@ -144,7 +144,7 @@ Paper_def::find_font (SCM fn, Real m) return unsmob_metrics (ly_cdr (met)); SCM ssc; - if (scope_p_->try_retrieve (ly_symbol2scm ("outputscale"), &ssc)) + if (variable_tab_->try_retrieve (ly_symbol2scm ("outputscale"), &ssc)) { m /= gh_scm2double (ssc); } diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 1c0681010a..7f1cfaac4c 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -21,8 +21,7 @@ #include "debug.hh" #include "font-metric.hh" #include "main.hh" -#include "scope.hh" - +#include "scm-hash.hh" #include "lily-version.hh" #include "paper-def.hh" #include "file-results.hh" @@ -95,7 +94,7 @@ Paper_outputter::output_scheme (SCM scm) } void -Paper_outputter::output_scope (Scope *scope, String prefix) +Paper_outputter::output_scope (Scheme_hash_table *scope, String prefix) { SCM al = scope->to_alist (); for (SCM s = al ; gh_pair_p (s); s = ly_cdr (s)) @@ -173,7 +172,7 @@ Paper_outputter::write_header_field_to_file (String filename, SCM key, SCM value } void -Paper_outputter::write_header_fields_to_file (Scope * header) +Paper_outputter::write_header_fields_to_file (Scheme_hash_table * header) { if (dump_header_fieldnames_global.size ()) { diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 2154b40bf5..a6f1168049 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -15,7 +15,7 @@ #include "paper-column.hh" #include "paper-score.hh" #include "paper-column.hh" -#include "scope.hh" +#include "scm-hash.hh" #include "gourlay-breaking.hh" #include "paper-outputter.hh" #include "file-results.hh" @@ -100,9 +100,9 @@ Paper_score::process () if (global_header_p) { - Scope gh (global_header_p); - outputter_l_->output_scope (&gh, "lilypond"); - outputter_l_->write_header_fields_to_file (&gh); + + outputter_l_->output_scope (global_header_p, "lilypond"); + outputter_l_->write_header_fields_to_file (global_header_p); } if (header_l_) { @@ -113,8 +113,8 @@ Paper_score::process () outputter_l_->output_comment (_ ("Outputting Score, defined at: ")); outputter_l_->output_comment (origin_str_); - if (paper_l_->scope_p_) - outputter_l_->output_scope (paper_l_->scope_p_, "lilypondpaper"); + if (paper_l_->variable_tab_) + outputter_l_->output_scope (paper_l_->variable_tab_, "lilypondpaper"); SCM scm = scm_list_n (ly_symbol2scm ("header-end"), SCM_UNDEFINED); outputter_l_->output_scheme (scm); diff --git a/lily/parser.yy b/lily/parser.yy index 9459adbf57..ae165c9c21 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -47,7 +47,6 @@ this. #include "property-iterator.hh" #include "file-results.hh" #include "input.hh" -#include "scope.hh" #include "relative-music.hh" #include "lyric-combine-music.hh" #include "transposed-music.hh" @@ -145,7 +144,6 @@ of the parse stack onto the heap. */ String *string; // needed by the lexer as temporary scratch area. Music *music; Score *score; - Scope *scope; Scheme_hash_table *scmhash; Music_output_def * outputdef; @@ -363,9 +361,9 @@ toplevel_expression: } | output_def { if (dynamic_cast ($1)) - THIS->lexer_p_->set_identifier ("$defaultpaper", $1->self_scm ()); + THIS->lexer_p_->set_identifier (gh_str02scm ("$defaultpaper"), $1->self_scm ()); else if (dynamic_cast ($1)) - THIS->lexer_p_->set_identifier ("$defaultmidi", $1->self_scm ()); + THIS->lexer_p_->set_identifier (gh_str02scm ("$defaultmidi"), $1->self_scm ()); } | embedded_scm { // junk value @@ -406,9 +404,7 @@ notenames_body: lilypond_header_body: { $$ = new Scheme_hash_table; - - Scope *sc = new Scope ($$); - THIS->lexer_p_-> scope_l_arr_.push (sc); + THIS->lexer_p_-> scope_l_arr_.push ($$); } | lilypond_header_body assignment { @@ -418,7 +414,7 @@ lilypond_header_body: lilypond_header: HEADER '{' lilypond_header_body '}' { $$ = $3; - delete THIS->lexer_p_-> scope_l_arr_.pop (); + THIS->lexer_p_->scope_l_arr_.pop (); } ; @@ -442,7 +438,7 @@ assignment: ip.warning (_ ("Identifier should have alphabetic characters only")); } - THIS->lexer_p_->set_identifier (ly_scm2string ($1), $4); + THIS->lexer_p_->set_identifier ($1, $4); /* TODO: devise standard for protection in parser. @@ -616,7 +612,7 @@ music_output_def_body: p = new Midi_def; $$ = p; - THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); + THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_); } | PAPER '{' { Music_output_def *id = unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultpaper")); @@ -625,20 +621,20 @@ music_output_def_body: p = dynamic_cast (id->clone ()); else p = new Paper_def; - THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_); + THIS-> lexer_p_-> scope_l_arr_.push (p->variable_tab_); $$ = p; } | PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER { Music_output_def *p = unsmob_music_output_def ($3); p = p->clone (); - THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); + THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_); $$ = p; } | MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER { Music_output_def *p = unsmob_music_output_def ($3); p = p->clone (); - THIS->lexer_p_->scope_l_arr_.push (p->scope_p_); + THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_); $$ = p; } | music_output_def_body assignment { diff --git a/lily/percent-repeat-item.cc b/lily/percent-repeat-item.cc index 68d3bd6c1f..47b2199270 100644 --- a/lily/percent-repeat-item.cc +++ b/lily/percent-repeat-item.cc @@ -77,9 +77,9 @@ Percent_repeat_item_interface::beat_slash (SCM grob) return m.smobbed_copy (); } - - - +ADD_INTERFACE (Percent_repeat_item_interface,"percent-repeat-interface", + "Repeats that look like percent signs", + "slope thickness"); diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index f51f9473b8..dc4b7d624b 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -147,7 +147,7 @@ Phrasing_slur_engraver::create_grobs () // push a new phrasing_slur onto stack. // (use temp. array to wait for all phrasing_slur STOPs) Grob* phrasing_slur = new Spanner (get_property ("PhrasingSlur")); - Slur::set_interface (phrasing_slur); + Slur::set_interface (phrasing_slur); // can't remove. SCM s = get_property ("phrasingSlurBeginAttachment"); if (gh_symbol_p (s)) { diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 5c9ca83d63..4afd70a14a 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -7,8 +7,10 @@ Chris Jackson - extended to support bracketed pedals. + TODO: support for __| |__ or __| Ped instead of ___/\__ for pedal up-down - */ + +*/ #include "engraver.hh" #include "musical-request.hh" @@ -172,8 +174,6 @@ Piano_pedal_engraver::create_grobs () { p->line_spanner_ = new Spanner (get_property ( ( String (p->name_) + "PedalLineSpanner").ch_C() )); Side_position_interface::set_axis (p->line_spanner_, Y_AXIS); - Axis_group_interface::set_interface (p->line_spanner_); - Axis_group_interface::set_axes (p->line_spanner_, Y_AXIS, Y_AXIS); Music * rq = (p->req_l_drul_[START] ? p->req_l_drul_[START] : p->req_l_drul_[STOP]); announce_grob (p->line_spanner_, rq->self_scm ()); } @@ -307,7 +307,6 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype) p->current_bracket_req_ = p->req_l_drul_[START]; p->bracket_p_ = new Spanner (get_property ("PianoPedalBracket")); - p->bracket_p_->set_interface (ly_symbol2scm ("piano-pedal-interface")); // Set a property so that the molecule-creating function will know whether the left edge should be flared \___ p->bracket_p_->set_grob_property("left-widen", gh_bool2scm((bool) p->req_l_drul_[STOP]) ); diff --git a/lily/porrectus.cc b/lily/porrectus.cc index d52d871d68..d811c380c3 100644 --- a/lily/porrectus.cc +++ b/lily/porrectus.cc @@ -178,12 +178,23 @@ Porrectus::brew_molecule (SCM smob) bool solid = to_boolean (me->get_grob_property ("solid")); bool add_stem = to_boolean (me->get_grob_property ("add-stem")); - SCM stem_direction_scm = me->get_grob_property ("stem-direction"); + /* + + TODO: + + ugr. why not called direction? + + */ + SCM stem_direction_scm = me->get_grob_property ("direction"); Direction stem_direction = gh_number_p (stem_direction_scm) ? to_dir (stem_direction_scm) : DOWN; if (!stem_direction) stem_direction = DOWN; + + /* + TODO: revise name. + */ bool auto_properties = to_boolean (me->get_grob_property ("auto-properties")); if (auto_properties) // determine add_stem and stem_direction automatically from durations @@ -231,7 +242,7 @@ Porrectus::brew_molecule (SCM smob) Molecule molecule; - SCM line_thickness_scm = me->get_grob_property ("line-thickness"); + SCM line_thickness_scm = me->get_grob_property ("thickness"); Real line_thickness; if (gh_number_p (line_thickness_scm)) { @@ -244,7 +255,7 @@ Porrectus::brew_molecule (SCM smob) Real thickness = line_thickness * me->paper_l ()->get_var ("stafflinethickness"); - SCM porrectus_width_scm = me->get_grob_property ("porrectus-width"); + SCM porrectus_width_scm = me->get_grob_property ("width"); Real porrectus_width; if (gh_number_p (porrectus_width_scm)) { @@ -480,3 +491,9 @@ Porrectus::brew_mensural_molecule (Item *me, molecule.translate_axis (ypos_correction, Y_AXIS); return molecule; } + + +ADD_INTERFACE (Porrectus,"porrectus-interface", + "A porrectus ligature, joining two note heads into a single grob.", + "left-head right-head width add-stem auto-properties solid direction"); + diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 7bdfbbf927..339540123b 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -39,7 +39,7 @@ Rest_collision_engraver::create_grobs () return; rest_collision_p_ = new Item (get_property ("RestCollision")); - Rest_collision::set_interface (rest_collision_p_); + announce_grob(rest_collision_p_, SCM_EOL); for (int i=0; i< note_column_l_arr_.size (); i++) Rest_collision::add_column (rest_collision_p_,note_column_l_arr_[i]); diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 9f4588d0ed..2569c7ab2b 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -81,7 +81,6 @@ head_characteristic (Grob * col) TODO: look at horizontal-shift to determine ordering between rests for more than two voices. - */ SCM Rest_collision::do_shift (Grob *me, SCM elts) @@ -245,12 +244,9 @@ Rest_collision::do_shift (Grob *me, SCM elts) return SCM_UNSPECIFIED; } -void -Rest_collision::set_interface (Grob*me) -{ - me->set_extent_callback (SCM_EOL, X_AXIS); - me->set_extent_callback (SCM_EOL, Y_AXIS); -} - +ADD_INTERFACE (Rest_collision,"rest-collision-interface", + "Move around ordinary rests (not multi-measure-rests) to avoid +conflicts.", + "maximum-rest-count minimum-distance elements"); diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index cb92159fec..2bb3506c49 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -66,7 +66,7 @@ Rest_engraver::process_music () if (rest_req_l_ && !rest_p_) { rest_p_ = new Item (get_property ("Rest")); - Rhythmic_head::set_interface (rest_p_); + int durlog = unsmob_duration (rest_req_l_->get_mus_property ("duration"))-> duration_log (); diff --git a/lily/rest.cc b/lily/rest.cc index 3e2f9539a1..aee966e1b1 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -120,3 +120,9 @@ Rest::has_interface (Grob*m) { return m && m->has_interface (ly_symbol2scm ("rest-interface")); } + + +ADD_INTERFACE (Rest,"rest-interface", + "a rest", + "style"); + diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 32b3061e7e..89ed54beb1 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -85,7 +85,6 @@ Rhythmic_column_engraver::create_grobs () if (!note_column_) { note_column_ = new Item (get_property ("NoteColumn")); - Note_column::set_interface (note_column_); announce_grob(note_column_, SCM_EOL); diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 16e482d957..dd20a029b8 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -49,14 +49,15 @@ Rhythmic_head::set_dots (Grob*me,Item *dot_l) } -void -Rhythmic_head::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("rhythmic-head-interface")); -} bool Rhythmic_head::has_interface (Grob*me) { return me && me->has_interface (ly_symbol2scm ("rhythmic-head-interface")); } + + +ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface", + "Note head or rest", + "dot stem duration-log"); + diff --git a/lily/scm-option.cc b/lily/scm-option.cc index e472f2878e..97ee9ec2c6 100644 --- a/lily/scm-option.cc +++ b/lily/scm-option.cc @@ -40,10 +40,7 @@ bool internal_type_checking_global_b; /* - TODO: verzin iets tegen optie code bloot - - - other interesting stuff to add: +add these as well: @item -T,--no-timestamps don't timestamp the output diff --git a/lily/scope.cc b/lily/scope.cc deleted file mode 100644 index a4a1c34d0a..0000000000 --- a/lily/scope.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* - scope.cc -- implement Scope - - source file of the GNU LilyPond music typesetter - - (c) 1998--2002 Han-Wen Nienhuys - - */ - -#include "scope.hh" -#include "string.hh" -#include "scm-hash.hh" - -Scope::Scope (Scheme_hash_table * st) -{ - assert (st); - id_dict_ =st; -} - -bool -Scope::elem_b (String s) const -{ - return id_dict_->elem_b (ly_symbol2scm (s.ch_C ())); -} - -bool -Scope::elem_b (SCM s) const -{ - return id_dict_->elem_b (s); -} - - -SCM -Scope::scm_elem (SCM s)const -{ - return id_dict_->get (s); -} - -SCM -Scope::scm_elem (String s) const -{ - return scm_elem (ly_symbol2scm (s.ch_C ())); -} - - -void -Scope::set (String s, SCM id) -{ - return id_dict_->set (ly_symbol2scm (s.ch_C ()), id); -} - -SCM -Scope::to_alist () const -{ - return id_dict_->to_alist (); -} - -bool -Scope::try_retrieve (SCM k , SCM *v)const -{ - return id_dict_->try_retrieve (k, v); -} - diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 899b1d0208..3d6e5d058b 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -273,7 +273,6 @@ Score_engraver::try_music (Music*r) /* TODO: use property Score.breakForbidden = #t */ - void Score_engraver::forbid_breaks () { diff --git a/lily/score.cc b/lily/score.cc index 9570c267f5..d8887be29f 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -8,7 +8,6 @@ #include "ly-smobs.icc" -#include "scm-hash.hh" #include "score.hh" #include "debug.hh" #include "music-output-def.hh" @@ -16,7 +15,7 @@ #include "music-iterator.hh" #include "music.hh" #include "global-translator.hh" -#include "scope.hh" +#include "scm-hash.hh" #include "cpu-timer.hh" #include "main.hh" #include "paper-def.hh" @@ -73,7 +72,9 @@ void Score::run_translator (Music_output_def *odef_l) { /* - TODO: this is not very elegant.... + We want to know if we want to store locations, since they take a + lot of overhead. + */ store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F); @@ -125,8 +126,8 @@ Score::run_translator (Music_output_def *odef_l) if (!header_p_) header_p_ = new Scheme_hash_table; // ugh - Scope bla (header_p_); - output->header_l_ = &bla; + + output->header_l_ = header_p_; output->origin_str_ = location_str (); progress_indication ("\n"); diff --git a/lily/scores.cc b/lily/scores.cc index db3e48736a..a8ef7d411f 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -19,7 +19,6 @@ #include "score.hh" #include "string.hh" #include "paper-def.hh" -#include "scope.hh" #include "debug.hh" #include "parray.hh" #include "file-path.hh" diff --git a/lily/script-column.cc b/lily/script-column.cc index f41264760c..59e28471c7 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -79,3 +79,9 @@ Script_column::before_line_breaking (SCM smob) return SCM_UNSPECIFIED; } + +ADD_INTERFACE (Script_column,"script-column-interface", + "An interface that sorts scripts according to their @code{script-priority}", + ""); + + diff --git a/lily/script.cc b/lily/script.cc index 5ae6152f3d..0280a52d17 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -84,9 +84,12 @@ Script::has_interface (Grob*me) return me->has_interface (ly_symbol2scm ("script-interface")); } -void -Script::set_interface (Grob*me) -{ - return me->set_interface (ly_symbol2scm ("script-interface")); -} + +ADD_INTERFACE (Text_script,"text-script-interface", + "Any text script", + "script-priority"); + +ADD_INTERFACE (Skript, "script-interface", + "", + "script-priority script-molecule staff-support"); diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index c8a74111c5..580919a04e 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -135,13 +135,14 @@ Separating_group_spanner::add_spacing_unit (Grob* me ,Item*i) } -void -Separating_group_spanner::set_interface (Grob*) -{ -} - bool Separating_group_spanner::has_interface (Grob*) {//todo assert (false); } + + + +ADD_INTERFACE (Separating_group_spanner,"separation-spanner-interface", + "Spanner that containing @code{separation-item-interface} grobs to calculate rods", + ""); diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 860b4519d5..81b3df8ced 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -1,5 +1,5 @@ /* - single-malt-grouping-item.cc -- implement Separation_item + separation-item.cc -- implement Separation_item source file of the GNU LilyPond music typesetter @@ -26,6 +26,11 @@ Separation_item::add_item (Grob*s,Item* i) s->add_dependency (i); } +/* + DOCME: + + why don't we use extent() + */ Interval Separation_item::my_width (Grob *me) { @@ -73,3 +78,13 @@ Separation_item::my_width (Grob *me) + + +ADD_INTERFACE (Separation_item,"separation-item-interface", + "Item that computes widths to generate spacing rods. + +Calc dimensions for the Separating_group_spanner; this has to be +an item to get dependencies correct. It can't be an grob_group +since these usually are in a different X_group +", + "elements"); diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index 57e6ea4899..61cf029270 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -14,7 +14,7 @@ /* - TODO: handling of grace notes is excuisite pain. This handling + TODO: handling of grace notes is exquisite pain. This handling should be formally specified and then the implementation verified. */ @@ -263,6 +263,7 @@ Sequential_music_iterator::get_music (Moment until)const Skip events till UNTIL. We don't do any other side effects such as descending to child iterator contexts, because they might depend on \context specs and \translator changes being executed + TODO: build support for grace notes here. */ void diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 9acf165858..4ce9df6761 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -335,3 +335,10 @@ Side_position_interface::supported_b (Grob*me) } + + +ADD_INTERFACE (Side_position_interface,"side-position-interface", + "Position a victim object (this one) next to other objects (the support). +#'direction = where to put the victim object (left or right?) +", + "side-support-elements direction-source direction side-relative-direction minimum-space padding self-alignment-X self-alignment-Y"); diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 9bf8e6a29e..806f5918e0 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -156,7 +156,7 @@ Slur_engraver::create_grobs () // push a new slur onto stack. // (use temp. array to wait for all slur STOPs) Grob* slur = new Spanner (get_property ("Slur")); - Slur::set_interface (slur); + Slur::set_interface (slur); // cannot remove yet! SCM s = get_property ("slurBeginAttachment"); if (gh_symbol_p (s)) { diff --git a/lily/slur.cc b/lily/slur.cc index 427cd0799a..2e0e9b57f7 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -9,11 +9,16 @@ /* [TODO] + * should avoid stafflines with horizontal part. + * begin and end should be treated as a/acknowledge Scripts. + * smart changing of endings + * smart changing of (Y-?)offsets to avoid ugly beziers (along-side-stem) + */ #include "directional-element-interface.hh" @@ -683,3 +688,7 @@ Slur::has_interface (Grob*me) } +ADD_INTERFACE (Slur,"slur-interface", + "A slur", + "slope-limit de-uglify-parameters details attachment direction attachment-offset beautiful y-free control-points extremity-rules extremity-offset-alist thickness dashed"); + diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 2695186b5d..30e1b0503e 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -80,8 +80,9 @@ Spaceable_grob::remove_interface (Grob*me) } -void -Spaceable_grob::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("spaceable-grob-interface")); -} +ADD_INTERFACE (Spaceable,"spaceable-grob-interface", + "An grob (generally a Paper_column) that takes part in the +spacing problem. ", + "penalty minimum-distances ideal-distances +left-neighbors right-neighbors"); + diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index f3c69d9976..2fff9c08e6 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -180,12 +180,31 @@ Spacing_spanner::prune_loose_colunms (Grob*me,Link_array *cols, Rational s Real space, fixed; fixed = 0.0; - bool expand_only; - Real base = note_spacing (me, lc, rc, shortest, &expand_only); - Note_spacing::get_spacing (sp, rc, base, increment, &space, &fixed); - space -=base; + bool dummy; + + if (d == LEFT) + { + /* + The note spacing should be taken from the musical + columns. + + */ + Real base = note_spacing (me, lc, rc, shortest, &dummy); + Note_spacing::get_spacing (sp, rc, base, increment, &space, &fixed); + + space -= increment; + + dists[d] = dists[d] >? space; + } + else + { + Real space, fixed_space; + Staff_spacing::get_spacing_params (sp, + &space, &fixed_space); + + dists[d] = dists[d] >? fixed_space; + } - dists[d] = dists[d] >? space; } } while (flip (&d) != LEFT); @@ -536,7 +555,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc /* - Read hints from L (todo: R) and generate springs. + Read hints from L and generate springs. */ void Spacing_spanner::breakable_column_spacing (Item* l, Item *r) @@ -670,3 +689,50 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, return dist; } + + +ADD_INTERFACE (Spacing_spanner,"spacing-spanner-interface", + " SPACE = arithmetic_multiplier * ( C + log2 (TIME) )) +The space taken by a note is determined by the formula + + + +where TIME is the amount of time a note occupies. The value of C is +chosen such that the smallest space within a measure is +arithmetic_basicspace: + +C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) + +The smallest space is the one following the shortest note in the +measure, or the space following a hypothetical 1/8 note. Typically +arithmetic_basicspace is set to a value so that the shortest note +takes about two noteheads of space (ie, is followed by a notehead of +space): + +@example +2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) )) + +@{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @} +@{ assuming: SHORTEST <= 1/8 @} + += arithmetic_multiplier * +( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) ) + += arithmetic_multiplier * arithmetic_basicspace + +@{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @} + += quartwidth * arithmetic_basicspace + +=> + +arithmetic_basicspace = 2/1 = 2 + + +If you want to space your music wider, use something like: + +arithmetic_basicspace = 4.; + +@end example", + "spacing-increment shortest-duration-space"); + diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index 02c5ab0f13..c2c3fd919c 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -57,7 +57,7 @@ Span_bar_engraver::acknowledge_grob (Grob_info i) if (bar_l_arr_.size () >= 2 && !spanbar_p_) { spanbar_p_ = new Item (get_property ("SpanBar")); - Span_bar::set_interface (spanbar_p_); + spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS); announce_grob (spanbar_p_, SCM_EOL); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index c1d82c6df0..0279cd2733 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -27,20 +27,22 @@ Span_bar::add_bar (Grob*me, Grob*b) MAKE_SCHEME_CALLBACK (Span_bar,brew_molecule,1); -/** - * Limitations/Bugs: - * - * (1) Elements from 'me->get_grob_property ("elements")' must be - * ordered according to their y coordinates relative to their common - * axis group parent. Otherwise, the computation goes mad. (TODO: - * apply a sort algorithm that ensures this precondition.) However, - * until now, I have seen no case where lily has not fulfilled this - * precondition. - * - * (2) This method depends on bar_engraver not being removed from - * staff context. If bar_engraver is removed, the size of the staff - * lines is evaluated as 0, which results in a solid span bar line - * with faulty y coordinate. +/* + Limitations/Bugs: + + (1) Elements from 'me->get_grob_property ("elements")' must be + ordered according to their y coordinates relative to their common + axis group parent. Otherwise, the computation goes mad. + + (TODO: + apply a sort algorithm that ensures this precondition.) However, + until now, I have seen no case where lily has not fulfilled this + precondition. + + (2) This method depends on bar_engraver not being removed from + staff context. If bar_engraver is removed, the size of the staff + lines is evaluated as 0, which results in a solid span bar line + with faulty y coordinate. */ /* @@ -245,17 +247,15 @@ Span_bar::get_bar_size (SCM smob) return gh_double2scm (iv.length ()); } -void -Span_bar::set_interface (Grob *me) -{ - Bar_line::set_interface (me); - - me->set_interface (ly_symbol2scm ("span-bar-interface")); - me->set_extent_callback (SCM_EOL, Y_AXIS); -} bool Span_bar::has_interface (Grob*m) { return m && m->has_interface (ly_symbol2scm ("span-bar-interface")); } + +ADD_INTERFACE (Span_bar,"span-bar-interface", + "A bar line that spans other barlines (typically used to get cross-staff barlines.", + ""); + + diff --git a/lily/spanner.cc b/lily/spanner.cc index 0b6573dd72..9e8be73b3b 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -17,7 +17,6 @@ #include "paper-outputter.hh" #include "paper-column.hh" #include "line-of-score.hh" - #include "group-interface.hh" void @@ -199,6 +198,9 @@ Spanner::Spanner (SCM s) { spanned_drul_[LEFT]=0; spanned_drul_[RIGHT]=0; + Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface")); + + } Spanner::Spanner (Spanner const &s) @@ -406,3 +408,8 @@ unsmob_spanner (SCM s ) { return dynamic_cast (unsmob_grob (s)); } + +ADD_INTERFACE(Spanner, + "spanner-interface", + "", + "minimum-length"); diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 5eab8ffbf2..8d7a5db7c3 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -179,7 +179,8 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed) *fixed = 1.0; Grob * separation_item=0; - + Item * me_item = dynamic_cast (me); + for (SCM s = me->get_grob_property ("left-items"); gh_pair_p (s); s = gh_cdr(s)) { @@ -212,7 +213,15 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed) if (!scm_list_p (alist)) return ; - SCM space_def = scm_sloppy_assq (ly_symbol2scm ("begin-of-note"), alist); + + SCM space_def = scm_sloppy_assq (ly_symbol2scm ("first-note"), alist); + if (me_item->break_status_dir () == CENTER) + { + SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist); + if (gh_pair_p (nndef )) + space_def = nndef; + } + if (!gh_pair_p (space_def)) { programming_error ("Unknown prefatory spacing. "); @@ -232,3 +241,8 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed) *space += next_notes_correction (me, last_grob); } + + +ADD_INTERFACE (Staff_spacing,"staff-spacing-interface", + "", + "left-items right-items"); diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index e63efa1b30..7e1b083883 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -160,9 +160,12 @@ compare_position (Grob *const &a, Grob * const &b) } -void -Staff_symbol_referencer::set_interface (Grob * e) -{ - e->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS); -} + + +ADD_INTERFACE (Staff_symbol_referencer,"staff-symbol-referencer-interface", + "Object whose Y position is meaning with reference to a staff +symbol. Objects that have this interface should include +Staff_symbol_referencer::callback in their Y-offset-callback. +", + "staff-position"); diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 65c7cca21e..de2ecf4e42 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -83,3 +83,11 @@ Staff_symbol::has_interface (Grob*m) { return m && m->has_interface (ly_symbol2scm ("staff-symbol-interface")); } + + + +ADD_INTERFACE (Staff_symbol,"staff-symbol-interface", + "This spanner draws the lines of a staff. The middle line is +position 0.", + "staff-space line-count invisible-staff"); + diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index a23d1430a8..c4cab0c3a1 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -62,9 +62,7 @@ Stem_engraver::acknowledge_grob (Grob_info i) if (!stem_p_) { stem_p_ = new Item (get_property ("Stem")); - Stem::set_interface (stem_p_); - Staff_symbol_referencer::set_interface (stem_p_); - + stem_p_->set_grob_property ("duration-log", gh_int2scm (duration_log)); if (tremolo_req_l_) @@ -89,9 +87,8 @@ Stem_engraver::acknowledge_grob (Grob_info i) if (requested_type) { tremolo_p_ = new Item (get_property ("StemTremolo")); - Stem_tremolo::set_interface (tremolo_p_); - announce_grob(tremolo_p_, tremolo_req_l_->self_scm()); + /* The number of tremolo flags is the number of flags of the tremolo-type minus the number of flags of the note @@ -101,7 +98,7 @@ Stem_engraver::acknowledge_grob (Grob_info i) - (duration_log > 2 ? duration_log - 2 : 0); if (tremolo_flags < 0) tremolo_flags = 0; - tremolo_p_->set_grob_property ("tremolo-flags", + tremolo_p_->set_grob_property ("flag-count", gh_int2scm (tremolo_flags)); } } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 597b7962f7..3a18323b32 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -22,16 +22,10 @@ lengthen stem if necessary */ -void -Stem_tremolo::set_interface (Grob *me) -{ - me->set_interface (ly_symbol2scm ("stem-tremolo")); -} - bool Stem_tremolo::has_interface (Grob *me) { - return me->has_interface (ly_symbol2scm ("stem-tremolo")); + return me->has_interface (ly_symbol2scm ("stem-tremolo-interface")); } MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2); @@ -76,9 +70,11 @@ Stem_tremolo::brew_molecule (SCM smob) if (beam) { Real dy = 0; - SCM s = beam->get_grob_property ("dy"); - if (gh_number_p (s)) - dy = gh_scm2double (s); + SCM s = beam->get_grob_property ("positions"); + if (gh_pair_p (s)) + { + dy = -gh_scm2double (gh_car (s)) +gh_scm2double (gh_cdr (s)); + } Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS) - Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS); dydx = dx ? dy/dx : 0; @@ -97,7 +93,7 @@ Stem_tremolo::brew_molecule (SCM smob) a.translate (Offset (-width/2, width / 2 * dydx)); int tremolo_flags; - SCM s = me->get_grob_property ("tremolo-flags"); + SCM s = me->get_grob_property ("flag-count"); if (gh_number_p (s)) tremolo_flags = gh_scm2int (s); else @@ -162,3 +158,7 @@ Stem_tremolo::set_stem (Grob*me,Grob *s) me->set_grob_property ("stem", s->self_scm ()); } + +ADD_INTERFACE (Stem_tremolo,"stem-tremolo-interface", + "", + "stem beam-width beam-thickness flag-count"); diff --git a/lily/stem.cc b/lily/stem.cc index 615417116c..91fe78c888 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -231,7 +231,12 @@ Stem::add_head (Grob*me, Grob *n) } else { - n->set_grob_property ("rest", n->self_scm ()); + /* + Apparently, this is never used. + */ +#if 0 + me->set_grob_property ("rest", n->self_scm ()); +#endif } } @@ -356,8 +361,8 @@ Stem::get_default_stem_end_position (Grob*me) bool no_extend_b = to_boolean (me->get_grob_property ("no-stem-extend")); - if (!grace_b && !no_extend_b && dir * st < 0) // junkme? - st = 0.0; + if (!grace_b && !no_extend_b && dir * st < 0) // junkme? + st = 0.0; return st; } @@ -795,8 +800,7 @@ Stem::has_interface (Grob*m) return m && m->has_interface (ly_symbol2scm ("stem-interface")); } -void -Stem::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("stem-interface")); -} +ADD_INTERFACE (Stem,"stem-interface", + "A stem", + "thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head heads direction length style no-stem-extend flag-style dir-forced"); + diff --git a/lily/syllable-group.cc b/lily/syllable-group.cc index 65aa936a37..e8973a6824 100644 --- a/lily/syllable-group.cc +++ b/lily/syllable-group.cc @@ -285,3 +285,9 @@ Syllable_group::make_entry () Syllable_group *vi = new Syllable_group; return vi->smobbed_self (); } + + +ADD_INTERFACE (Lyric_syllable,"lyric-syllable-interface", + "a single piece of lyrics", + "word-space alignment ignore-length-mismatch begin-alignment end-alignment"); + diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 6d3846cd03..5ad1bc6c6e 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -57,11 +57,6 @@ Will not fix it since I'm not sure. return mol; } -void -System_start_delimiter::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("system-start-delimiter-interface")); -} bool System_start_delimiter::has_interface (Grob*me) @@ -185,3 +180,9 @@ System_start_delimiter::staff_brace (Grob*me, Real y) return Molecule (b, at); } + + + +ADD_INTERFACE (System_start_delimiter,"system-start-delimiter-interface", + "#'style can be bar-line, bracket or brace", + "bar-line-collapse-height brace-collapse-height bracket-collapse-height thickness arch-height arch-angle arch-thick arch-width bracket-thick glyph"); diff --git a/lily/system.cc b/lily/system.cc index 3405d68f28..75f0bf4916 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -36,9 +36,6 @@ System::System (SCM s) : Spanner (s) { rank_i_ = 0; - - Axis_group_interface::set_interface (this); - Axis_group_interface::set_axes (this, Y_AXIS,X_AXIS); } int @@ -538,3 +535,15 @@ System::column_l_arr ()const return acs; } + + + +ADD_INTERFACE (System,"system-interface", + "Super grob, parent of all: + +The columns of a score that form one line. The toplevel grob. Any +grob has a Line_of_score as both X and Y reference point. The +Paper_score contains one grob of this type. Control enters the +Grob dependency calculation from this single Line_of_score +object.", + "between-system-string spacing-procedure before-line-breaking-callback after-line-breaking-callback all-elements columns"); diff --git a/lily/text-item.cc b/lily/text-item.cc index b165e86711..194028ab3f 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -246,3 +246,9 @@ Text_item::brew_molecule (SCM smob) return mol.smobbed_copy (); } + + + +ADD_INTERFACE (Text_item,"text-interface", + "A scheme markup text", + "text align baseline-skip lookup raise kern word-space magnify"); diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 6457d433c3..0ff02bf2e0 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -22,7 +22,7 @@ source file of the GNU LilyPond music typesetter /* TODO: - vertical start / vertical end (fixme-name) | - - contination types (vert. star, vert. end) |-> eat volta-spanner + - contination types (vert. star, vert. end) |-> eat volta-bracket - more styles - more texts/positions */ @@ -291,3 +291,16 @@ Text_spanner::setup_pedal_bracket(Spanner *me) me->set_grob_property ("shorten-pair", gh_cons ( gh_double2scm ( shorten[LEFT] ), gh_double2scm ( shorten[RIGHT] ) )); } + + + +ADD_INTERFACE (Pianopedal,"piano-pedal-interface", + "", + "pedal-type edge-width edge-height shorten-pair text-start left-widen right-widen"); + + + +ADD_INTERFACE (Text_spanner,"text-spanner-interface", + "generic text spanner", + "dash-period dash-length edge-height edge-width edge-text shorten-pair type"); + diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 9c46164bb6..a2c34f6e62 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -16,13 +16,6 @@ -void -Tie_column::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("tie-column-interface")); - me->set_extent_callback (SCM_EOL, X_AXIS); - me->set_extent_callback (SCM_EOL, Y_AXIS) ; -} bool Tie_column::has_interface (Grob*me) @@ -122,3 +115,10 @@ Tie_column::after_line_breaking (SCM smob) set_directions (unsmob_grob (smob)); return SCM_UNSPECIFIED; } + + + +ADD_INTERFACE (Tie_column,"tie-column-interface", + "that sets tie directions in a tied chord", + "direction"); + diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 079d6e84ee..447b5ee143 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -156,7 +156,7 @@ Tie_engraver::create_grobs () Spanner * p = new Spanner (basic); - Tie::set_interface (p); + Tie::set_interface (p); // cannot remove. Tie::set_head (p,LEFT, dynamic_cast (unsmob_grob (ly_car (pair)))); Tie::set_head (p,RIGHT, dynamic_cast (unsmob_grob (ly_cdr (pair)))); @@ -166,7 +166,7 @@ Tie_engraver::create_grobs () else for (SCM s = head_list; gh_pair_p (s); s = ly_cdr (s)) { Grob * p = new Spanner (basic); - Tie::set_interface (p); + Tie::set_interface (p); // cannot remove yet! Tie::set_head (p, LEFT, dynamic_cast (unsmob_grob (ly_caar (s)))); Tie::set_head (p, RIGHT, dynamic_cast (unsmob_grob (ly_cdar (s)))); @@ -178,7 +178,7 @@ Tie_engraver::create_grobs () if (tie_p_arr_.size () > 1 && !tie_column_p_) { tie_column_p_ = new Spanner (get_property ("TieColumn")); - Tie_column::set_interface (tie_column_p_); + for (int i = tie_p_arr_.size (); i--;) Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]); announce_grob(tie_column_p_, SCM_EOL); diff --git a/lily/tie.cc b/lily/tie.cc index 2dea2b8846..688a12dece 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -50,7 +50,6 @@ void Tie::set_interface (Grob*me) { me->set_grob_property ("heads", gh_cons (SCM_EOL, SCM_EOL)); - me->set_interface (ly_symbol2scm ("tie-interface")); } bool @@ -311,3 +310,8 @@ Tie::brew_molecule (SCM smob) } + +ADD_INTERFACE (Tie,"tie-interface", + "A tie connecting two noteheads. +direction = Forced direction for all ties", + "y-offset staffline-clearance control-points heads details thickness x-gap direction minimum-length"); diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 1ba5fb873a..0513157775 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -122,3 +122,34 @@ Time_signature::time_signature (Grob*me,int num, int den) return m; } + + +ADD_INTERFACE (Time_signature,"time-signature-interface", + "A time signature, in different styles. + The following values for 'style are are recognized: + + @table @samp + @item @code{C} + 4/4 and 2/2 are typeset as C and struck C, respectively. All + other time signatures are written with two digits. + + @item @code{old} + 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are + typeset with old-style mensuration marks. All other time + signatures are written with two digits. + + @item @code{1xxx} + All time signatures are typeset with a single + digit, e.g. 3/2 is written as 3. (Any symbol starting + with the digit @code{1} will do.) + + @item @code{C}@var{M}@code{/}@var{N}, +@code{old}@var{M}@code{/}@var{N} or + @code{old6/8alt} + Tells LilyPond to use a specific symbol as time signature, + regardless of the actual time signature. + @end table + +See also the test-file @file{input/test/time.ly}. +", + "fraction style"); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index dc74135a3c..da4f058540 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -16,7 +16,7 @@ #include "paper-column.hh" #include "paper-def.hh" #include "text-item.hh" -#include "tuplet-spanner.hh" +#include "tuplet-bracket.hh" #include "stem.hh" #include "note-column.hh" #include "dimensions.hh" @@ -26,9 +26,6 @@ #include "staff-symbol-referencer.hh" /* - TODO: - staff-line collisions for horizontal tuplet brackets. - TODO: in the case that there is no bracket, but there is a (single) beam, @@ -37,13 +34,6 @@ */ - -void -Tuplet_bracket::set_interface (Grob*me) -{ - me->set_interface (ly_symbol2scm ("tuplet-bracket")); -} - MAKE_SCHEME_CALLBACK (Tuplet_bracket,brew_molecule,1); SCM Tuplet_bracket::brew_molecule (SCM smob) @@ -302,3 +292,16 @@ Tuplet_bracket::add_column (Grob*me, Item*n) } +bool +Tuplet_bracket::has_interface (Grob*me) +{ + return me->has_interface (ly_symbol2scm ("tuplet-bracket-interface")); +} + + + + +ADD_INTERFACE (Tuplet_bracket,"tuplet-bracket-interface", + "A bracket with a number in the middle, used for tuplets.", + "columns number-gap delta-y tuplet-bracket-visibility tuplet-number-visibility thick direction"); + diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index f3a73c8e10..8ace269d13 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -9,7 +9,7 @@ #include "command-request.hh" -#include "tuplet-spanner.hh" +#include "tuplet-bracket.hh" #include "note-column.hh" #include "time-scaled-music.hh" #include "beam.hh" @@ -75,7 +75,7 @@ Tuplet_engraver::create_grobs () continue; Spanner* glep = new Spanner (get_property ("TupletBracket")); - Tuplet_bracket::set_interface (glep); + if (i >= started_span_p_arr_.size ()) started_span_p_arr_.push (glep); else diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 6a6889eb95..6203c86b0a 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -9,7 +9,7 @@ #include "engraver.hh" #include "translator-group.hh" -#include "volta-spanner.hh" +#include "volta-bracket.hh" #include "item.hh" #include "note-column.hh" #include "bar-line.hh" @@ -140,7 +140,7 @@ Volta_engraver::create_grobs () started_mom_ = now_mom () ; volta_span_p_ = new Spanner (get_property ("VoltaBracket")); - Volta_spanner::set_interface (volta_span_p_); + announce_grob (volta_span_p_, SCM_EOL); volta_span_p_->set_grob_property ("text", start_str_); } @@ -154,14 +154,14 @@ Volta_engraver::acknowledge_grob (Grob_info i) if (Note_column::has_interface (item)) { if (volta_span_p_) - Volta_spanner::add_column (volta_span_p_,item); + Volta_bracket_interface::add_column (volta_span_p_,item); } if (Bar_line::has_interface (item)) { if (volta_span_p_) - Volta_spanner::add_bar (volta_span_p_, item); + Volta_bracket_interface::add_bar (volta_span_p_, item); if (end_volta_span_p_) - Volta_spanner::add_bar (end_volta_span_p_ , item); + Volta_bracket_interface::add_bar (end_volta_span_p_ , item); } } else if (Staff_symbol::has_interface (i.grob_l_)) diff --git a/ly/grace-init.ly b/ly/grace-init.ly index b139a85bff..c03ea803d4 100644 --- a/ly/grace-init.ly +++ b/ly/grace-init.ly @@ -1,8 +1,4 @@ -#(define (grace-beam-space-function multiplicity) - (* (if (<= multiplicity 3) 0.816 0.844) 0.8)) - - startGraceMusic = { \property Voice.Stem \override #'direction = #1 \property Voice.Stem \override #'length = #6 @@ -26,7 +22,6 @@ startGraceMusic = { stopGraceMusic = { \property Staff.Accidentals \revert #'font-relative-size - \property Voice.Beam \revert #'space-function \property Voice.Beam \revert #'thickness \property Voice.Stem \revert #'flag-style diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 3297d0b433..86b88a954d 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.5.46 -Entered-date: 23MRT02 +Version: 1.5.47 +Entered-date: 24MRT02 Description: @BLURB@ Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.5.46.tar.gz + 1000k lilypond-1.5.47.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.5.46.tar.gz + 1000k lilypond-1.5.47.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.mandrake.spec b/make/out/lilypond.mandrake.spec index 10895b152a..74d6cdf916 100644 --- a/make/out/lilypond.mandrake.spec +++ b/make/out/lilypond.mandrake.spec @@ -1,5 +1,5 @@ %define name lilypond -%define version 1.5.46 +%define version 1.5.47 %define release 1mdk Name: %{name} diff --git a/make/out/lilypond.redhat.spec b/make/out/lilypond.redhat.spec index acfd4ceb79..67e41d113e 100644 --- a/make/out/lilypond.redhat.spec +++ b/make/out/lilypond.redhat.spec @@ -3,11 +3,11 @@ %define info yes Name: lilypond -Version: 1.5.46 +Version: 1.5.47 Release: 1 License: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.46.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.47.tar.gz Summary: Create and print music notation URL: http://www.lilypond.org/ BuildRoot: /tmp/lilypond-install diff --git a/make/out/lilypond.suse.spec b/make/out/lilypond.suse.spec index 9764eec9e6..b170b23015 100644 --- a/make/out/lilypond.suse.spec +++ b/make/out/lilypond.suse.spec @@ -14,11 +14,11 @@ Distribution: SuSE Linux 7.0 (i386) Name: lilypond -Version: 1.5.46 +Version: 1.5.47 Release: 2 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.46.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.47.tar.gz # music notation software for.. ? Summary: A program for printing sheet music. URL: http://www.lilypond.org/ diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 5a667fe1f8..0a576e5467 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -27,12 +27,13 @@ $(outdir)/cmr10.afm: LOG_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.log) $(PARMESAN_FILES:.mf=.log)) TEXTABLES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.tex) $(PARMESAN_FILES:.mf=.tex)) AFM_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.afm) $(PARMESAN_FILES:.mf=.afm) $(AF_FILES:.af=.afm) $(addsuffix .afm, $(CM_AFM_FILES))) +ENC_FILES=$(TEXTABLES:.tex=.enc) TFM_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.tfm)) # Make tfm files first, log files last, # so that normally log files aren't made twice -ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(AFM_FILES) $(TFM_FILES) $(LOG_FILES) +ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(AFM_FILES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)" INSTALLATION_DIR=$(datadir)/fonts/source @@ -54,6 +55,7 @@ INSTALLATION_OUT_FILES3=$(TFM_FILES) #MAKE_PFA_FILES=1 PFA_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.pfa)) + ifdef MAKE_PFA_FILES ALL_GEN_FILES += $(PFA_FILES) $(outdir)/lilypond.map INSTALLATION_OUT_DIR4=$(datadir)/fonts/type1 @@ -74,8 +76,8 @@ $(outdir)/lilypond.map: ## ## todo: this also depends on .tfm, FIXME. -$(outdir)/%.afm $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log - $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(texi (cdr handle)))) (propdoc (backend-property->texi sym))) - + (cons (car propdoc) (string-append (cdr propdoc) "\nDefault value: " - defval)))) + defval))) + ) (define (document-interface where interface grob-description) + (let* ((level (if (eq? where 'grob) 3 2)) (name (car interface)) (desc (cadr interface)) (props (caddr interface)) - (docfunc (lambda (x) + (docfunc (lambda (pr) (document-grob-property - x grob-description ))) + pr grob-description ))) (docs (map docfunc props))) (string-append @@ -68,22 +73,21 @@ (node (interface-name name)) (document-interface 'self interface '())))) + ;; First level grob description (define (document-grob iname description) (processing iname) (let* ((metah (assoc 'meta description)) - (meta (if (pair? metah) - (cdr metah) - '((properties . ()) (name . "huh?")) - )) - + (meta (cdr metah)) (name (cdr (assoc 'name meta))) - (ifaces (cdr (assoc 'interface-descriptions meta))) - (ifacedoc (map (lambda (x) - (document-interface 'grob x description)) - (reverse ifaces)))) + (ifaces (map lookup-interface (cdr (assoc 'interfaces meta)))) + (ifacedoc (map (lambda (iface) + (document-interface 'grob iface description)) + (reverse ifaces))) + ) + (string-append (node (grob-name name)) (texi-section 2 (grob-name name) #f) @@ -100,7 +104,9 @@ (map engraver-name engraver-names))))) (apply string-append ifacedoc)))) - + + + (define (engraver-makes-grob? name-symbol grav) (memq name-symbol (assoc 'grobs-created (Translator::description grav))) ) @@ -144,11 +150,45 @@ (define interface-description-alist - (map (lambda (x) (cons (string->symbol x) (eval-string x))) - (interface-names))) + (hash-fold + (lambda (key val prior) + (cons (cons key val) prior) + ) + '() (ly-all-grob-interfaces))) (set! interface-description-alist (sort interface-description-alist alistattachment-coordinates) - (meta . ,(grob-description rhythmic-head-interface font-interface note-head-interface)) + (meta . ((interfaces . (rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface)))) )) (Glissando @@ -471,7 +475,7 @@ (X-extent-callback . #f) (Y-extent-callback . #f) (molecule-callback . ,Line_spanner::brew_molecule) - (meta . ,(grob-description line-spanner-interface)) + (meta . ((interfaces . (line-spanner-interface)))) )) (VoiceFollower @@ -482,14 +486,14 @@ (X-extent-callback . #f) (Y-extent-callback . #f) (molecule-callback . ,Line_spanner::brew_molecule) - (meta . ,(grob-description line-spanner-interface)) + (meta . ((interfaces . (line-spanner-interface)))) )) (NoteName . ( (molecule-callback . ,Text_item::brew_molecule) (font-family . roman) - (meta . ,(grob-description note-name-interface font-interface)) + (meta . ((interfaces . (note-name-interface text-interface font-interface)))) )) (OctavateEight @@ -502,14 +506,16 @@ (molecule-callback . ,Text_item::brew_molecule) (font-shape . italic) (font-family . roman) - (meta . ,(grob-description text-interface font-interface )) + (meta . ((interfaces . (text-interface side-position-interface font-interface)))) )) (PaperColumn . ( - (axes 0) - ; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") - (meta . ,(grob-description paper-column-interface axis-group-interface spaceable-element-interface)) + (axes . (0)) + (X-extent-callback . ,Axis_group_interface::group_extent_callback) + +; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f) + (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface)))) )) (PhrasingSlur @@ -521,7 +527,7 @@ (after-line-breaking-callback . ,Slur::after_line_breaking) (extremity-rules . ,default-slur-extremity-rules) (extremity-offset-alist . ,default-phrasing-slur-extremity-offset-alist) - (de-uglify-parameters . ( 1.5 0.8 -2.0)) + (de-uglify-parameters . (1.5 0.8 -2.0)) (Y-extent-callback . ,Slur::height) (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (bezier-pct-c0 . -0.2) (bezier-pct-c3 . 0.000006) @@ -532,15 +538,19 @@ (attachment . (#f . #f)) (attachment-offset . ((0 . 0) . (0 . 0))) (slope-limit . 0.8) - (meta . ,(grob-description slur-interface)) + (meta . ((interfaces . (slur-interface)))) )) (NonMusicalPaperColumn . ( - (axes 0) - ; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") - (meta . ,(grob-description paper-column-interface - axis-group-interface spaceable-element-interface)) + (axes . (0)) + (X-extent-callback . ,Axis_group_interface::group_extent_callback) + + ;; debugging stuff: print column number. +; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f) + + + (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface)))) )) (PercentRepeat @@ -551,7 +561,7 @@ (thickness . 0.48) (minimum-width . 12.5) ; staffspace (font-family . music) - (meta . ,(grob-description multi-measure-rest-interface font-interface percent-repeat-interface)) + (meta . ((interfaces . (multi-measure-rest-interface font-interface percent-repeat-interface)))) )) (PianoPedalBracket ;; an example of a text spanner @@ -567,7 +577,7 @@ (edge-height . (1.0 . 1.0)) (shorten-pair . (0.0 . 0.0)) (thickness . 1.0) - (meta . ,(grob-description piano-pedal-interface)) + (meta . ((interfaces . (piano-pedal-interface)))) )) (RepeatSlash @@ -575,7 +585,7 @@ (molecule-callback . , Percent_repeat_item_interface::beat_slash) (thickness . 0.48) (slope . 1.7) - (meta . ,(grob-description percent-repeat-interface)) + (meta . ((interfaces . (percent-repeat-interface)))) )) (Rest . ( @@ -585,16 +595,17 @@ (molecule-callback . ,Rest::brew_molecule) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (minimum-beam-collision-distance . 1.5) - (meta . ,(grob-description - rhythmic-head-interface - staff-symbol-referencer-interface - rest-interface)) - )) + (meta . ( + (interfaces . (font-interface + rhythmic-head-interface + staff-symbol-referencer-interface + rest-interface)) + )))) (RestCollision . ( (minimum-distance . 0.75) - (meta . ,(grob-description rest-collision-interface )) + (meta . ((interfaces . (rest-collision-interface)))) )) (Script @@ -605,13 +616,13 @@ (X-offset-callbacks . (,Side_position_interface::centered_on_parent)) (before-line-breaking-callback . ,Script::before_line_breaking) (font-family . music) - (meta . ,(grob-description script-interface side-position-interface font-interface)) + (meta . ((interfaces . (script-interface side-position-interface font-interface)))) )) (ScriptColumn . ( (before-line-breaking-callback . ,Script_column::before_line_breaking) - (meta . ,(grob-description script-column-interface)) + (meta . ((interfaces . (script-column-interface)))) )) (Slur @@ -623,7 +634,7 @@ (after-line-breaking-callback . ,Slur::after_line_breaking) (extremity-rules . ,default-slur-extremity-rules) (extremity-offset-alist . ,default-slur-extremity-offset-alist) - (de-uglify-parameters . ( 1.5 0.8 -2.0)) + (de-uglify-parameters . (1.5 0.8 -2.0)) (Y-extent-callback . ,Slur::height) (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (bezier-pct-c0 . -0.2) (bezier-pct-c3 . 0.000006) @@ -634,7 +645,7 @@ (attachment . (#f . #f)) (attachment-offset . ((0 . 0) . (0 . 0))) (slope-limit . 0.8) - (meta . ,(grob-description slur-interface)) + (meta . ((interfaces . (slur-interface)))) )) (SpacingSpanner @@ -645,11 +656,8 @@ (shortest-duration-space . 2.0) (spacing-increment . 1.2) - (X-extent-callback . #f) - (Y-extent-callback . #f) - - (meta . ,(grob-description spacing-spanner-interface)) + (meta . ((interfaces . (spacing-spanner-interface)))) )) (SpanBar @@ -659,6 +667,7 @@ (molecule-callback . ,Span_bar::brew_molecule) (visibility-lambda . ,begin-of-line-invisible) (X-extent-callback . ,Span_bar::width_callback) + (Y-extent-callback . ()) (breakable . #t) (glyph . "|") (before-line-breaking-callback . ,Span_bar::before_line_breaking) @@ -671,7 +680,7 @@ (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - (meta . ,(grob-description span-bar-interface bar-line-interface )) + (meta . ((interfaces . (span-bar-interface bar-line-interface)))) )) (StanzaNumber @@ -681,24 +690,20 @@ (break-align-symbol . clef) (visibility-lambda . ,begin-of-line-visible) (font-family . roman) - (meta . ,(grob-description break-aligned-interface text-interface font-interface)) + (meta . ((interfaces . (break-aligned-interface text-interface font-interface)))) )) (StaffSpacing . ( (breakable . #t) - (X-extent-callback . #f) (stem-spacing-correction . 0.4) - (Y-extent-callback . #f) - (meta . ,(grob-description staff-spacing-interface)) + (meta . ((interfaces . (staff-spacing-interface)))) )) (NoteSpacing . ( - (X-extent-callback . #f) - (Y-extent-callback . #f) (stem-spacing-correction . 0.5) (space-factor . 1.0) - (meta . ,(grob-description note-spacing-interface)) + (meta . ((interfaces . (note-spacing-interface)))) )) (StaffSymbol @@ -707,7 +712,7 @@ (staff-space . 1.0) (line-count . 5) (layer . 0) - (meta . ,(grob-description staff-symbol-interface )) + (meta . ((interfaces . (staff-symbol-interface)))) )) (SostenutoPedal @@ -721,16 +726,18 @@ (font-family . roman) (font-shape . italic) (self-alignment-X . 0) - (meta . ,(grob-description text-interface font-interface)) + (meta . ((interfaces . (text-interface font-interface)))) )) (SostenutoPedalLineSpanner . ( - (axes . ( 1)) + (axes . (1)) + (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (padding . 1.2) (minimum-space . 1.0) (direction . -1) - (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface)) + (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface)))) )) (Stem @@ -752,9 +759,10 @@ (X-offset-callbacks . (,Stem::off_callback)) (X-extent-callback . ,Stem::dim_callback) (Y-extent-callback . ,Stem::height) + (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (adjust-if-on-staffline . #t) (font-family . music) - (meta . ,(grob-description stem-interface font-interface)) + (meta . ((interfaces . (stem-interface font-interface)))) )) (StemTremolo @@ -765,18 +773,18 @@ (beam-width . 2.0) ; staff-space (beam-thickness . 0.48) ; staff-space - (meta . ,(grob-description stem-tremolo-interface )) + (meta . ((interfaces . (stem-tremolo-interface)))) )) (SeparationItem . ( - (meta . ,(grob-description separation-item-interface )) + (meta . ((interfaces . (separation-item-interface)))) )) (SeparatingGroupSpanner . ( (spacing-procedure . ,Separating_group_spanner::set_spacing_rods) - (meta . ,(grob-description separation-spanner-interface)) + (meta . ((interfaces . (separation-spanner-interface)))) )) (SustainPedal @@ -788,22 +796,26 @@ (padding . 0.0) ;; padding relative to SustainPedalLineSpanner (pedal-type . text) (X-offset-callbacks . (,Side_position_interface::aligned_on_self)) - (meta . ,(grob-description piano-pedal-interface side-position-interface font-interface)) + (meta . ((interfaces . (piano-pedal-interface text-spanner-interface text-interface side-position-interface font-interface)))) )) (SustainPedalLineSpanner . ( - (axes . ( 1)) + (axes . (1)) + (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (padding . 1.2) (minimum-space . 1.0) (direction . -1) - (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface)) + (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface)))) )) (System . ( (axes . (0 1)) - (meta . ,(grob-description line-of-score-interface axis-group-interface)) + (X-extent-callback . ,Axis_group_interface::group_extent_callback) + (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (meta . ((interfaces . (system-interface axis-group-interface)))) )) (SystemStartBrace @@ -813,7 +825,7 @@ (collapse-height . 5.0) (font-family . braces) (Y-extent-callback . #f) - (meta . ,(grob-description system-start-delimiter-interface font-interface)) + (meta . ((interfaces . (system-start-delimiter-interface font-interface)))) )) (SystemStartBracket @@ -827,7 +839,7 @@ (arch-width . 1.5) (bracket-collapse-height . 1) (thickness . 0.25) - (meta . ,(grob-description system-start-delimiter-interface )) + (meta . ((interfaces . (system-start-delimiter-interface)))) )) (SystemStartBar @@ -837,7 +849,7 @@ (glyph . "bar-line") (thickness . 1.6) (after-line-breaking-callback . ,System_start_delimiter::after_line_breaking) - (meta . ,(grob-description system-start-delimiter-interface )) + (meta . ((interfaces . (system-start-delimiter-interface)))) )) (TextScript @@ -849,7 +861,7 @@ ;; todo: add X self alignment? (baseline-skip . 2) (font-family . roman) - (meta . ,(grob-description text-script-interface text-interface side-position-interface font-interface )) + (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface)))) )) (TextSpanner @@ -863,7 +875,7 @@ (width-correct . -1) (direction . 1) - (meta . ,(grob-description text-spanner-interface font-interface)) + (meta . ((interfaces . (text-spanner-interface font-interface)))) )) (Tie @@ -876,13 +888,15 @@ (x-gap . 0.2) (y-offset . 0.6) (minimum-length . 2.5) - (meta . ,(grob-description tie-interface )) + (meta . ((interfaces . (tie-interface)))) )) (TieColumn . ( (after-line-breaking-callback . ,Tie_column::after_line_breaking) - (meta . ,(grob-description tie-column-interface )) + (X-extent-callback . ()) + (Yoo-extent-callback . ()) + (meta . ((interfaces . (tie-column-interface)))) )) (TimeSignature @@ -891,13 +905,13 @@ (break-align-symbol . time-signature) (visibility-lambda . ,all-visible) (space-alist . ( - (begin-of-note . (extra-space . 2.0)) + (first-note . (extra-space . 2.0)) (staff-bar . (minimum-space . 2.0)) )) (breakable . #t) (style . C) (font-family . number) - (meta . ,(grob-description time-signature-interface font-interface)) + (meta . ((interfaces . (time-signature-interface font-interface)))) )) (TupletBracket @@ -909,8 +923,7 @@ (font-family . roman) (font-shape . italic) (font-relative-size . -1) - (meta . ,(grob-description text-interface - tuplet-bracket-interface font-interface)) + (meta . ((interfaces . (text-interface tuplet-bracket-interface font-interface)))) )) (UnaCordaPedal @@ -924,21 +937,22 @@ (pedal-type . text) (padding . 0.0) ;; padding relative to UnaCordaPedalLineSpanner (X-offset-callbacks . (,Side_position_interface::aligned_on_self)) - (meta . ,(grob-description text-interface font-interface)) + (meta . ((interfaces . (text-interface font-interface)))) )) (UnaCordaPedalLineSpanner . ( - (axes . ( 1)) + (axes . (1)) + (Y-extent-callback . ,Axis_group_interface::group_extent_callback) (padding . 1.2) (minimum-space . 1.0) (direction . -1) - (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface)) + (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface)))) )) (VoltaBracket . ( - (molecule-callback . ,Volta_spanner::brew_molecule) + (molecule-callback . ,Volta_bracket_interface::brew_molecule) (direction . 1) (padding . 1) (font-style . volta) @@ -948,25 +962,26 @@ (minimum-space . 5) (font-family . number) (font-relative-size . -2) - (meta . ,(grob-description volta-bracket-interface side-position-interface font-interface)) + (meta . ((interfaces . (volta-bracket-interface text-interface side-position-interface font-interface)))) )) (VerticalAlignment . ( - (axes 1) + (axes . (1)) (Y-extent-callback . ,Axis_group_interface::group_extent_callback) - (X-extent-callback . #f) (stacking-dir . -1) - (meta . ,(grob-description align-interface axis-group-interface)) + (meta . ((interfaces . (align-interface axis-group-interface)))) )) (VerticalAxisGroup . ( - (axes 1) - (meta . ,(grob-description axis-group-interface)) + (axes . (1)) + (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + + (meta . ((interfaces . (axis-group-interface)))) )) - ) - ) + ) + ) @@ -974,14 +989,19 @@ (define (completize-grob-entry x) "transplant assoc key into 'name entry of 'meta of X " - (let* ((name-sym (car x)) - (entry (cdr x)) - (metaentry (cdr (assoc 'meta entry))) - (new-metaentry (assoc-set! metaentry 'name name-sym)) - ) - (cons name-sym (assoc-set! entry 'meta new-metaentry)) - )) + (let* ((name-sym (car x)) + (grob-entry (cdr x)) + (metaentry (cdr (assoc 'meta grob-entry))) + (ifaces-entry + (cdr (assoc 'interfaces metaentry))) + + ) + (set! metaentry (assoc-set! metaentry 'name name-sym)) + (set! metaentry (assoc-set! metaentry 'interfaces + (cons 'grob-interface ifaces-entry))) + (set! grob-entry (assoc-set! grob-entry 'meta metaentry)) + (cons name-sym grob-entry))) (set! all-grob-descriptions (map completize-grob-entry all-grob-descriptions)) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 9b7c43bcf8..cb86a25200 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -69,19 +69,14 @@ In the case of alignment grobs, this should contain only one number.") (grob-property-description 'beam ly-grob? "pointer to the beam, if applicable.") (grob-property-description 'beam-thickness number? "thickness, measured in staffspace.") (grob-property-description 'beam-width number? "width of the tremolo sign.") -(grob-property-description 'beamAuto boolean? "enable autobeaming?.") (grob-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity .") (grob-property-description 'beamed-minimum-lengths list? "list of minimum stem lengths given beam multiplicity.") (grob-property-description 'beamed-stem-shorten number? "shorten beamed stems in forced direction.") (grob-property-description 'beaming number-pair? "number of beams extending to left and right.") -(grob-property-description 'beams list? "list of beam ptrs.") (grob-property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.") -(grob-property-description 'before-grace-spacing-factor number? " stretch space this much if there are grace notes before the column.") (grob-property-description 'before-line-breaking-callback procedure? "Procedure taking grob as argument. This procedure is called (using dependency resolution) before line breaking, but after generating discretionary items. Return value is ignored.") -(grob-property-description 'before-musical-spacing-factor number? "space before musical columns (eg. taken by accidentals) get this much -stretched when they follow a musical column, in absence of grace -notes. 0.0 means no extra space (accidentals are ignored).") +(grob-property-description 'between-cols pair? "Where to attach a loose column to") (grob-property-description 'between-system-string string? "string to dump between two systems. Useful for forcing pagebreaks.") (grob-property-description 'bounded-by-me list? "list of spanners that have this @@ -104,9 +99,7 @@ square of the inner notes involved.") (grob-property-description 'bar-line-collapse-height number? "Minimum height of system start delimiter bar-line glyphs. If equal or smaller, the bar-line is removed.") (grob-property-description 'brace-collapse-height number? "Minimum height of system start delimiter brace glyphs. If equal or smaller, the brace is removed.") (grob-property-description 'bracket-collapse-height number? "Minimum height of system start delimiter bracket glyphs. If equal or smaller, the bracket is removed.") -(grob-property-description 'column-space-strength number? "relative strength of space following breakable columns (eg. prefatory matter).") (grob-property-description 'columns list? "list of grobs, typically containing paper-columns, list of note-columns.") -(grob-property-description 'contains-grace boolean? "Used to widen entries for grace notes.") (grob-property-description 'control-points list? "List of 4 offsets (number-pairs) that form control points for the tie/slur shape.") (grob-property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams .") (grob-property-description 'dash-length number? "the length of a dash.") @@ -134,13 +127,12 @@ mean centre distance weighted per note @end table ") -(grob-property-description 'dir-list list? "list of stem directions, needed for optical spacing correction.") (grob-property-description 'direction dir? "up or down, left or right?.") (grob-property-description 'direction-source ly-grob? "in case side-relative-direction is set, which grob to get the direction from .") (grob-property-description 'dot ly-grob? "reference to Dots object.") (grob-property-description 'dot-count integer? "number of dots.") (grob-property-description 'duration-log integer? "2-log of the notehead duration, i.e. 0=whole note, 1 = half note, etc.") -(grob-property-description 'dy number? "set by beam: vertical travel height") + (grob-property-description 'edge-height pair? "a cons that specifies the heights of the vertical edges '(LEFT-height . RIGHT-height).") (grob-property-description 'edge-width pair? "a cons that specifies the widths of the slanted edges '(LEFT-width . RIGHT-width).") (grob-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text).") @@ -199,7 +191,6 @@ FIXME: in Tie this is a pair of grob pointers, pointing to the two heads of the .") (grob-property-description 'height number? "in staffspace.") (grob-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}.") -(grob-property-description 'horizontal-space number? "amount of space to add after a note (in staff-space).") (grob-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs.") (grob-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.") (grob-property-description 'inversion list? " musical-pitch, optional.") @@ -213,6 +204,9 @@ For barline, space after a thick line.") (grob-property-description 'layer number? "The output layer [0..2]. The default is 1.") (grob-property-description 'left-padding number? "space left of accs.") +(grob-property-description 'right-head ly-grob? "") +(grob-property-description 'left-head ly-grob? "") + (grob-property-description 'left-widen boolean? "Whether the left edge of a piano pedal bracket should be widened by the first element of edge-width.") (grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.") @@ -223,10 +217,8 @@ use @code{\outputproperty}. @code{\property .. \override} will not work: @code{\override} is processed after the StaffSymbol is created, and will have no effect. ") -(grob-property-description 'line-thickness number? "the thickness[stafflinethickness] of the line.") (grob-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name.") (grob-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts.") -(grob-property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.") (grob-property-description 'maximum-length number? "don't make Grob longer than this") (grob-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.") (grob-property-description 'measure-count integer? "number of measures for a multimeasure rest.") @@ -263,13 +255,7 @@ FIXME: also pair? (cons LEFT RIGHT) (grob-property-description 'note-heads list? "List of note head grobs") (grob-property-description 'number-gap number? "size of the gap for tohe number in a tuplet.") (grob-property-description 'old-accidentals list? "list of (pitch, accidental) pairs.") -(grob-property-description 'origin ly-input-location? "location in input file of the definition.") -(grob-property-description 'outer-stem-length-limit number? "catch -suspect beam slopes, set slope to zero if outer stem is lengthened -more than this (in staffspace).") - (grob-property-description 'padding number? "add this much extra space between objects that are next to each other.") -(grob-property-description 'parallel-beam boolean? "internal: true if there is a beam just as wide as the bracket .") (grob-property-description 'paren-cautionaries boolean? "Whether to add parenthesis around cautionary accidentals.") (grob-property-description 'pedal-type symbol? "Style of piano pedal: text, bracket or mixed.") (grob-property-description 'penalty number? "Penalty for breaking at @@ -278,7 +264,6 @@ means force linebreak. Other values influence linebreaking decisions as a real penalty.") (grob-property-description 'pitches list? "list of musical-pitch.") -(grob-property-description 'porrectus-width number? "width of the porrectus ligature measured in staff space.") (grob-property-description 'positions pair? "cons of staff positions (LEFT . RIGHT") (grob-property-description 'raise number? "height for text to be raised (a negative value lowers the text.") (grob-property-description 'right-padding number? "space right of accs.") @@ -309,7 +294,6 @@ TODO: revise typing.") spacing tuples: format = (SYMBOL . (TYPE . DISTANCE)), where TYPE can be minimum-space or extra-space.") -(grob-property-description 'space-factor number? "Scale horizontal spacing up by this amount.") (grob-property-description 'spacing-procedure procedure? "procedure taking grob as argument. This is called after before-line-breaking-callback, but before the actual line breaking @@ -324,16 +308,11 @@ itself. Return value is ignored.") does the stem attach to the notehead? Function takes a symbol argument being the style. It returns a (X . Y) pair, specifying location in terms of note head bounding box.") -(grob-property-description 'stem-direction dir? "up or down?. - -[docme: why not direction] -") (grob-property-description 'stem-end-position number? "Where does the stem end (the end is opposite to the support-head.") -(grob-property-description 'stem-length number? "length of stem.") + (grob-property-description 'stem-shorten list? "shorten stems in forced directions given flag multiplicity.") (grob-property-description 'stem-spacing-correction number? "optical correction amount. [TODO: doco] ") (grob-property-description 'stems list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.") -(grob-property-description 'stretch-distance number-pair? "pair of distances.") (grob-property-description 'style symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. .") (grob-property-description 'support-head ly-grob? "the note head at one end of the stem.") @@ -421,11 +400,10 @@ Like @code{tuplet-bracket-visibility}, but for the number.") (grob-property-description 'ignore-length-mismatch boolean? "if #t, stanzas with shorter lyrics can be moved away from their respective note-head by the lyric alignment code.") (grob-property-description 'begin-alignment number? "proportion of lyric length from beginning to align with note-head for left-aligned lyrics.") (grob-property-description 'end-alignment number? "proportion of lyric length from end to align with note-head for right-aligned lyrics.") +(grob-property-description 'width number? "width of a grob measured in staff space.") (grob-property-description 'x-gap number? "horizontal gap between notehead and tie.") (grob-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems.") (grob-property-description 'y-offset number? "extra vertical offset for ties away from the center line.") -(grob-property-description 'y number? "set by beam: position of left edge.") - ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;; INTERNAL @@ -454,7 +432,7 @@ columns. (grob-property-description 'accidentals-grob ly-grob? "accidentals for this note.") (grob-property-description 'causes list? "list of cause objects.") -(grob-property-description 'tremolo-flags number? "") +(grob-property-description 'flag-count number? "") (grob-property-description 'chord-tremolo boolean? "if set, this beam is a tremolo. TODO: use interface for this!") (grob-property-description 'chord pair? "?") (grob-property-description 'begin-of-line-visible boolean? "?") diff --git a/scm/interface-description.scm b/scm/interface-description.scm index 3e765fa1ea..9af686f69f 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -8,806 +8,25 @@ ; should include default value? - -;;; FIXME: naming. -;;; Score elements are called `objects' now and then, which gets -;;; rather confusing, we now have `elements', `items', `spanners' -;;; and `objects'. - - -;;; TODO: this should be done through C++ macros, in order to have -;;; tighter coupling between the C++ and its doco. - -(define all-interfaces '()) - -(define (lily-interface symbol description props) - (set! all-interfaces (acons symbol (list symbol - description - props) all-interfaces) - ) - ) - -(define (grob-description . interfaces) - (let* ((ifs (cons grob-interface interfaces)) - (props (map caddr ifs)) - ; (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x))) - ; (apply append props))) - (syms (map car ifs)) - ) - (list (cons 'separator "\n\n\n") ;easy printing. - (cons 'interfaces syms) - (cons 'interface-descriptions ifs) - ; (cons 'interface-descriptions (cadr merged)) - ;; description of the grob itself? - ; (cons 'properties prop-typep-pairs) - ))) - - -(lily-interface - 'grob-interface - "All grobs support this" - '( - X-offset-callbacks - Y-offset-callbacks - X-extent-callback - Y-extent-callback - molecule-callback - font-relative-size - extra-offset - interfaces - dependencies - no-spacing-rods - extra-extent-X - extra-extent-Y - minimum-extent-X - minimum-extent-Y - origin - transparent - )) - - -(lily-interface - 'beam-interface - "A beam. - -#'thickness= weight of beams, in staffspace - " - '(auto-knee-gap - beamed-stem-shorten - damping - flag-width-function - neutral-direction - outer-stem-length-limit - positions - slope-limit - thickness - ) - ) - -(lily-interface - 'staff-spacing-interface - "" - '( - )) - -(lily-interface - 'note-spacing-interface - "" - '( - )) - -(lily-interface - 'clef-interface - "A clef sign" - '( - non-default - full-size-change - glyph - )) - - - -(lily-interface - 'axis-group-interface - "a group of coupled grobs" - '( - axes - )) - - -(lily-interface - 'note-column-interface - "Stem and noteheads combined" - '( - note-heads - horizontal-shift - force-hshift - )) - - -(lily-interface - 'stem-interface - "A stem" - '( - thickness - beamed-lengths - beamed-minimum-lengths - lengths - beam - stem-shorten - duration-log - beaming - neutral-direction - stem-end-position - support-head - heads - direction - length - style - flag-style - dir-forced - )) - - - -(lily-interface - 'slur-interface - "A slur" - '( - de-uglify-parameters - details - attachment - direction - attachment-offset - beautiful - y-free - control-points - extremity-rules - extremity-offset-alist - thickness - dashed - - ) - ) - - - -(lily-interface - 'side-position-interface - "Position a victim object (this one) next to other objects (the support). -#'direction = where to put the victim object (left or right?) -" - '( - side-support-elements - direction-source - direction - side-relative-direction - minimum-space - padding - self-alignment-X - self-alignment-Y - - ) - ) - - -(lily-interface - 'accidentals-interface - "Accidentals" - '(accidentals - left-padding - right-padding - paren-cautionaries - cautionary-size - )) - - - -(lily-interface - 'line-of-score-interface - "Super grob, parent of all: - -The columns of a score that form one line. The toplevel grob. Any -grob has a Line_of_score as both X and Y reference point. The -Paper_score contains one grob of this type. Control enters the -Grob dependency calculation from this single Line_of_score -object." - '( - between-system-string - spacing-procedure - before-line-breaking-callback - after-line-breaking-callback - all-elements - columns - )) - - -(lily-interface - 'note-head-interface - "Note head" - '( style stem-attachment-function )) - - -(lily-interface - 'note-name-interface +(ly-add-interface +'note-name-interface "Note name" - '( style )) - - - -(lily-interface - 'rhythmic-head-interface - "Note head or rest" - '( - dot - stem - duration-log - )) - - -(lily-interface - 'rest-interface - "a rest" - '(style )) - - -(lily-interface - 'tuplet-bracket-interface - "A bracket with a number in the middle, used for tuplets." - '( - columns - number-gap - delta-y - tuplet-bracket-visibility - tuplet-number-visibility - thick - direction - )) - - -(lily-interface - 'align-interface - " Order grobs top to bottom/left to right/right to left etc." - '( - stacking-dir - align-dir - threshold - alignment-done - center-element - elements - axes - )) - - -(lily-interface - 'aligned-interface - "read by align-interface" - '( - minimum-space - extra-space - )) - - -(lily-interface - 'break-aligned-interface - "Items that are aligned in prefatory matter" - '( - break-align-symbol - space-alist - visibility-lambda - breakable - )) - - -(lily-interface - 'chord-name-interface - "generate a chord name" - '( pitches inversion bass)) - - -(lily-interface - 'time-signature-interface - "A time signature, in different styles. - The following values for 'style are are recognized: - - @table @samp - @item @code{C} - 4/4 and 2/2 are typeset as C and struck C, respectively. All - other time signatures are written with two digits. - - @item @code{old} - 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are - typeset with old-style mensuration marks. All other time - signatures are written with two digits. - - @item @code{1xxx} - All time signatures are typeset with a single - digit, e.g. 3/2 is written as 3. (Any symbol starting - with the digit @code{1} will do.) - - @item @code{C}@var{M}@code{/}@var{N}, -@code{old}@var{M}@code{/}@var{N} or - @code{old6/8alt} - Tells LilyPond to use a specific symbol as time signature, - regardless of the actual time signature. - @end table - -See also the test-file @file{input/test/time.ly}. -" - '(fraction style )) - - -(lily-interface - 'bar-line-interface - "Bar line. - -This is a request to print a special bar symbol. It replaces the -regular bar symbol with a special -symbol. The argument @var{bartype} is a string which specifies the -kind of bar to print. Options are @code{\":|\"} -@cindex \"|A@@@code{:|} -, -@code{\"|:\"} -@cindex \"|B@@@code{|:} -, @code{\":|:\"} -@cindex \"|C@@@code{:|:} -, -@code{\"||\"} -@cindex \"|D@@@code{||} -, @code{\"|.\"} -@cindex \"|E@@@code{|.} -, -@code{\".|\"} -@cindex \"|F@@@code{.|} -, and @code{\".|.\"} -@cindex \"|G@@@code{.|.} -. - -These produce, respectively, a right repeat, a left repeat, a double -repeat, a double bar, a start bar, an end bar, and a thick double bar. -If @var{bartype} is set to @code{\"empty\"} then nothing is printed, -but a line break is allowed at that spot. - -" - '(bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function )) - - -(lily-interface - 'hairpin-interface - "hairpin crescendo. - -padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf' - -" - '( grow-direction thickness height padding - )) - - -(lily-interface - 'arpeggio-interface - "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads." - '(stems arpeggio-direction)) - - - -(lily-interface - 'note-collision-interface - "An object that handles collisions between notes with different -stem directions and horizontal shifts. Most of the interesting -properties are to be set in @ref{note-column-interface}" - '(merge-differently-dotted note-width)) - - - -(lily-interface - 'custos-interface - "A custos is a staff context symbol that appears at the end of a - staff line with monophonic musical contents (i.e. with a single - voice). It anticipates the pitch of the first note of the following - line and thus helps the player or singer to manage line breaks - during performance, thus enhancing readability of a score. - - Custodes were frequently used in music notation until the 16th - century. There were different appearences for different notation - styles. Nowadays, they have survived only in special forms of - musical notation such as via the editio vaticana dating back to the - beginning of the 20th century. - -[TODO: add to glossary]" - - '(style)) - - - + '(style)) - - - (lily-interface - 'dots-interface - "The dots to go with a notehead/rest. A separate interface, since they -are a party in collision resolution. -#'direction is the Direction to handle staff-line collisions in." - '(direction dot-count)) - - - (lily-interface - 'font-interface - "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)" - '(font-style font-series font-shape font-family font-name -font-design-size font-relative-size) - ) - - - - (lily-interface - 'text-interface - "A scheme markup text" - '(text align baseline-skip lookup raise kern magnify)) - - - (lily-interface - 'dot-column-interface - "Interface that groups dots so they form a column" - '( ) - ) - - - (lily-interface - 'dynamic-interface +(ly-add-interface + 'dynamic-interface "Any kind of loudness sign" '() ) +(ly-add-interface + 'finger-interface + "A fingering instruction" + '() + ) - - (lily-interface - 'finger-interface - "A fingering instruction" - '() - ) - - - (lily-interface - 'separation-spanner-interface - "Spanner that containing @code{separation-item-interface} grobs to calculate rods" - '() - ) - - (lily-interface - 'text-script-interface - "Any text script" - '() - ) - - - (lily-interface - 'grace-alignment-interface - "put grace notes in line" - '( - horizontal-space - ) - ) - - - (lily-interface - 'hara-kiri-group-interface - " As Vertical_group_spanner, but keep track of interesting items. If -we don't contain any interesting items after linebreaking, then -gracefully commit suicide. Objective: don't disgrace Lily by -typesetting empty lines in orchestral scores." - '( items-worth-living ) -) - - - (lily-interface - 'line-spanner-interface - "Generic line drawn between two objects, eg. for use with glissandi. -gap is measured in staff-spaces. " - - '(gap dash-period dash-length line-thickness type - )) - - - (lily-interface - 'lyric-hyphen-interface - "A centred hyphen is a simple line between lyrics used to divide -syllables. The length of the hyphen line should stretch based on the -size of the gap between syllables." - - '( thickness height minimum-length word-space - )) - - - (lily-interface - 'key-signature-interface - "A group of accidentals." - '( - c0-position - old-accidentals - new-accidentals - )) - - - (lily-interface - 'lyric-extender-interface - "The extender is a simple line at the baseline of the lyric -that helps show the length of a melissima (tied/slurred note)." - '( - word-space - height - right-trim-amount - )) - - - - (lily-interface - 'lyric-syllable-interface - "a single piece of lyrics" - '( - word-space - alignment - ignore-length-mismatch - begin-alignment - end-alignment - )) - - - - (lily-interface - 'mark-interface - "a rehearsal mark" - '( - )) - - - (lily-interface - 'multi-measure-rest-interface - "A rest that spans a whole number of measures. For typesetting the -numbers, fields from font-interface may be used. - -padding is the space between number and rest. Measured in staffspace. - -" - '( columns expand-limit minimum-width padding)) - - - (lily-interface - 'paper-column-interface - "" - - '(column-space-strength before-musical-spacing-factor -stem-spacing-correction before-grace-spacing-factor when bounded-by-me -dir-list shortest-playing-duration shortest-starter-duration -contains-grace extra-space stretch-distance )) - - - (lily-interface - 'piano-pedal-interface - "" - '(pedal-type - edge-width - edge-height - shorten-pair - left-widen - right-widen - )) - - - (lily-interface - 'porrectus-interface - "A porrectus ligature, joining two note heads into a single grob." - '( - )) - - - (lily-interface - 'spaceable-element-interface - "An grob (generally a Paper_column) that takes part in the -spacing problem. " - '(penalty - minimum-distances - ideal-distances - dir-list - )) - - - (lily-interface - 'rest-collision-interface - "Move around ordinary rests (not multi-measure-rests) to avoid -conflicts." - '( - maximum-rest-count - minimum-distance - elements - )) - - - (lily-interface - 'script-interface - "" - '( - script-priority - )) - - - (lily-interface - 'script-column-interface - "An interface that sorts scripts according to their @code{script-priority}" - '( )) - - - - (lily-interface - 'spacing-spanner-interface - " SPACE = arithmetic_multiplier * ( C + log2 (TIME) )) -The space taken by a note is determined by the formula - - - -where TIME is the amount of time a note occupies. The value of C is -chosen such that the smallest space within a measure is -arithmetic_basicspace: - -C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) - -The smallest space is the one following the shortest note in the -measure, or the space following a hypothetical 1/8 note. Typically -arithmetic_basicspace is set to a value so that the shortest note -takes about two noteheads of space (ie, is followed by a notehead of -space): - -@example -2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) )) - -@{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @} -@{ assuming: SHORTEST <= 1/8 @} - -= arithmetic_multiplier * -( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) ) - -= arithmetic_multiplier * arithmetic_basicspace - -@{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @} - -= quartwidth * arithmetic_basicspace - -=> - -arithmetic_basicspace = 2/1 = 2 - - -If you want to space your music wider, use something like: - -arithmetic_basicspace = 4.; - -@end example" - '( -spacing-increment -shortest-duration-space - - )) - - - (lily-interface - 'staff-symbol-referencer-interface - - "Object whose Y position is meaning with reference to a staff -symbol. Objects that have this interface should include -Staff_symbol_referencer::callback in their Y-offset-callback. -" - '( - staff-symbol - staff-position - )) - - - (lily-interface - 'staff-symbol-interface - "This spanner draws the lines of a staff. The middle line is -position 0." - '( - staff-space - line-count - invisible-staff - )) - - - (lily-interface - 'stem-tremolo-interface - "" - '( stem beam-width beam-thickness - )) - - - (lily-interface - 'separation-item-interface - "Item that computes widths to generate spacing rods. - -Calc dimensions for the Separating_group_spanner; this has to be -an item to get dependencies correct. It can't be an grob_group -since these usually are in a different X_group -" - '( - elements - )) - - - (lily-interface - 'system-start-delimiter-interface - "#'style can be bar-line, bracket or brace" - '(bar-line-collapse-height brace-collapse-height bracket-collapse-height - thickness arch-height arch-angle arch-thick - arch-width bracket-thick glyph )) - - - (lily-interface - 'text-spanner-interface - "generic text spanner" - '( - dash-period - dash-length - line-thickness - edge-height - edge-width - edge-text - shorten-pair - type -)) - - - (lily-interface - 'tie-interface - "A tie connecting two noteheads. -direction = Forced direction for all ties" - - '( - staffline-clearance - control-points - heads - details - thickness - x-gap - direction - minimum-length - )) - - - - - (lily-interface - 'tie-column-interface - "that sets tie directions in a tied chord" - '(direction - )) - -(lily-interface - 'percent-repeat-interface - "Repeats that look like percent signs" - '(slope thickness)) - -(lily-interface - 'volta-bracket-interface - "Volta bracket with number" - '( - bars - thickness - height - )) - - -(lily-interface - 'span-bar-interface - "A bar line that spans other barlines (typically used to get cross-staff barlines." +(ly-add-interface + 'mark-interface + "a rehearsal mark" '( )) - - -(primitive-eval (cons - 'begin - (map (lambda (x) (list 'define (car x) (list 'quote (cdr x)))) - all-interfaces))) - - -(define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces)) - - diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index da78c42198..75d80b0657 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -552,15 +552,16 @@ lily output file in TFILES after that, and return the Latex file constructed. ' s = s + '\\include{%s}\n' \ % string.join (extra['latexheaders'], '}\n\\include{') + unit = extra['unit'][-1] + textheight = '' if extra['textheight']: - textheight = ',textheight=%fpt' % extra['textheight'][0] + textheight = ',textheight=%f%s' % (extra['textheight'][0], unit) orientation = 'portrait' if extra['orientation']: orientation = extra['orientation'][0] - unit = extra['unit'][-1] # set sane geometry width (a4-width) for linewidth = -1. maxlw = max (extra['linewidth'] + [-1]) if maxlw < 0: diff --git a/stepmake/stepmake/metafont-rules.make b/stepmake/stepmake/metafont-rules.make index a8faef9595..ffc021aab9 100644 --- a/stepmake/stepmake/metafont-rules.make +++ b/stepmake/stepmake/metafont-rules.make @@ -29,11 +29,11 @@ $(outdir)/%.$(XPM_RESOLUTION)pk: $(outdir)/%.$(XPM_RESOLUTION)gf $(outdir)/%.pfa: %.mf - pktrace --simplify --keep-trying $(basename $(@F)) + pktrace -I $(outdir)/ --pfa --simplify --keep-trying $(basename $(@F)) mv $(basename $(@F)).pfa $(outdir) $(outdir)/%.pfb: %.mf - pktrace --simplify --keep-trying $(basename $(@F)) + pktrace -I $(outdir)/ --pfb --simplify --keep-trying $(basename $(@F)) mv $(basename $(@F)).pfb $(outdir) #%.afm: