]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.97
authorfred <fred>
Wed, 27 Mar 2002 00:01:27 +0000 (00:01 +0000)
committerfred <fred>
Wed, 27 Mar 2002 00:01:27 +0000 (00:01 +0000)
74 files changed:
Documentation/index.texi
Documentation/user/GNUmakefile
Documentation/user/mudela-book.tely
NEWS
input/emacs-lily.fly [new file with mode: 0644]
input/les-nereides.ly
input/test/markup.ly [new file with mode: 0644]
lily/GNUmakefile
lily/align-interface.cc
lily/arpeggio.cc
lily/bar.cc
lily/chord-name.cc
lily/include/align-interface.hh
lily/include/arpeggio.hh
lily/include/axis-group-interface.hh
lily/include/beam.hh
lily/include/break-align-item.hh
lily/include/chord-name.hh
lily/include/clef.hh
lily/include/collision.hh
lily/include/crescendo.hh
lily/include/dots.hh
lily/include/grace-align-item.hh
lily/include/hyphen-spanner.hh
lily/include/key-item.hh
lily/include/lookup.hh
lily/include/ly-smobs.icc
lily/include/lyric-extender.hh
lily/include/multi-measure-rest.hh
lily/include/note-head.hh
lily/include/paper-column.hh
lily/include/rest.hh
lily/include/rhythmic-head.hh
lily/include/side-position-interface.hh
lily/include/slur.hh
lily/include/smobs.hh
lily/include/spaceable-element.hh
lily/include/spacing-spanner.hh
lily/include/span-bar.hh
lily/include/staff-symbol.hh
lily/include/stem-tremolo.hh
lily/include/text-item.hh [new file with mode: 0644]
lily/include/tie.hh
lily/include/volta-spanner.hh
lily/lookup.cc
lily/mark-engraver.cc
lily/midi-item.cc
lily/moment.cc
lily/multi-measure-rest.cc
lily/my-lily-lexer.cc
lily/score-element.cc
lily/score-engraver.cc
lily/slur.cc
lily/spaceable-element.cc
lily/spacing-spanner.cc
lily/span-arpeggio-engraver.cc
lily/text-item.cc
lily/text-spanner.cc
lily/tie-column.cc
lily/time-signature.cc
lily/translator-group.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc
ly/chord-modifiers.ly
ly/declarations-as.ly
ly/declarations.ly
ly/dynamic-scripts.ly [new file with mode: 0644]
ly/generate-documentation.ly [new file with mode: 0644]
scm/basic-properties.scm
scm/generate-documentation.scm [new file with mode: 0644]
scm/lily.scm
scm/slur.scm
scripts/etf2ly.py
scripts/mudela-book.py

index 3b1f3e2258533804ad1559964489c63de2b1aac7..6ed47693cff9ae833a4f01e5e9a091dc6610f403 100644 (file)
@@ -22,6 +22,7 @@
 @itemize @bullet
 @item @uref{../user/out-www/lilypond.html,LilyPond reference manual}
 also available in @uref{../user/out-www/lilypond.ps.gz,Postscript}
+@item @uref{../user/out-www/backend.html,LilyPond backend reference}
 @item @uref{../user/out-www/glossary.html,A glossary of musical
 terms}, includes translations.  Also available in @uref{../user/out-www/glossary.ps.gz,Postscript})
 @item @uref{../user/out-www/mudela-book.html,mudela-book}, a tool for
index 6b7186af4beebaf159f9423fd5a19721005a81c7..98e71f00e625190be21af4f738aee823657d72fa 100644 (file)
@@ -28,12 +28,14 @@ dvi: $(DVI_FILES)
 ps: $(PS_FILES)
 
 # urg
-default:
+default: 
 
-local-WWW: $(HTML_FILES)   $(datafiles) $(PS_GZ_FILES)
-       $(PYTHON) $(step-bindir)/ls-latex.py --title 'User documentation' \
-          $(DOC_FILES) $(TEX_FILES) $(TELY_FILES) \
-         | sed "s!$(outdir)/!!g" > $(outdir)/index.html
+local-WWW: $(HTML_FILES)   $(datafiles) $(PS_GZ_FILES) backdoc
+       true
+
+#      $(PYTHON) $(step-bindir)/ls-latex.py --title 'User documentation' \
+#         $(DOC_FILES) $(TEX_FILES) $(TELY_FILES) \
+#        | sed "s!$(outdir)/!!g" > $(outdir)/index.html
 
 $(outdir)/%.bib: %.bib
        ln -f $< $@
@@ -42,3 +44,7 @@ $(outdir)/%.bib: %.bib
 
 localclean:
        rm -f fonts.aux fonts.log feta*.tfm feta*.*pk 
+
+#ugh. out/ hardcoded.
+backdoc:
+       (cd $(outdir); $(topdir)/lily/out/lilypond $(depth)/../ly/generate-documentation)
index b135ca2f9012a2cad3c099475f1ee5bba6281490..ae77afe0d203654f960b0cb51dbef3900569e16e 100644 (file)
@@ -318,6 +318,9 @@ TeXinfo input will be written to a file with ext @file{.texi}. So be
 careful, don't give the source file that ext, or the file will be
 overwritten.
 
+If you use @code{--outdir}, you should also @code{cd} to that directory
+before running LaTeX or makeinfo.
+
 @strong{[UGH: IS THIS THE BEST WAY TO DO IT. MAYBE ADD A COMMENT LINE TO THE
 GENERATED FILE, SO MUDELA-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE
 IS GENERATED.]}
@@ -395,11 +398,6 @@ The La@TeX{} \includeonly@{...@} command is ignored.
 
 Ignores almost all La@TeX{} commands that changes margins and linewidths.
 
-La@TeX{} comments can confuse @command{mudela-book}:
-@example
-% this music will be displayed: \mudela@{c d e@}
-@end example
-
 @section Authors
 
 @email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
diff --git a/NEWS b/NEWS
index a35ea9667956b9b59766d586733b83bae1c05298..de0d3f6cf14e66dc88cd45b5f0e3b62700b231a8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,7 +15,7 @@ internals: LilyPond is smaller, cleaner, more flexible, etc.
 
  - Improved robustness: Lily almost never crashes.
 
-* Piano pedal support
+* Piano pedal support, Arpeggios
 
 * MIDI: dynamics, tempo changes
 
diff --git a/input/emacs-lily.fly b/input/emacs-lily.fly
new file mode 100644 (file)
index 0000000..1fda480
--- /dev/null
@@ -0,0 +1 @@
+cpp -P -traditional -o l-fake.ly  -DFAKE_GRACE les-nereides.ly
\ No newline at end of file
index 79a08e0f8e3e7c25023e213a5b7a512feedb2c36..36eeadb3c2328702ee915668f33744436e0320e9 100644 (file)
@@ -19,6 +19,15 @@ cpp -P -traditional -o l-fake.ly  -DFAKE_GRACE les-nereides.ly
  #(define (grace-beam-space-function multiplicity)
          (* (if (<= multiplicity 3) 0.816 0.844) 0.8))
 
+%% cpp: don't start on first column
+ #(define (make-text-checker text)
+  (lambda (elt)
+     ;; huh, string-match undefined?
+     ;; (string-match text (ly-get-elt-property elt 'text))
+     (equal? text (ly-get-elt-property elt 'text))
+    ))
+
+
 global = \notes{
     \partial 2;
     \key a \major;
@@ -40,26 +49,51 @@ treble = \context Voice=treble \notes\relative c''{
     \property Voice.NoteColumn \push #'horizontal-shift = #0
     \outputproperty #(make-type-checker 'text-item-interface) 
            #'extra-offset = #'(-6 . 2)
+    %% *Style* = Large??
+    \property Voice.TextScript \push #'style = #"Large"
     r2^"Allegretto scherzando"
+    \property Voice.TextScript \pop #'style
     %2
     \property Voice.Stem \pop #'direction
     \property Voice.Stem \push #'direction = #1
     r4 <cis\arpeggio eis a cis> r2
     %3
     r4 <cis\arpeggio fis a cis> r8.
+    % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \translator Staff=bass
+    % Get back
+    \context Voice 
+    \outputproperty #(make-text-checker "m.d.")
+           #'extra-offset = #'(-3 . -4)
+    % currently, this can't be (small) italic, because in the paperblock
+    % we set italic_magnifictation to get large italics.
     cis,16^2^"m.d."( <fis8 fis,> <e! e,!>
     %4
     <)dis,4 a' dis>
+    % Urg, this lifts us up to staff context
     \translator Staff=treble
+    % Get back
+    \context Voice 
     \property Voice.Slur \pop #'direction
     \property Voice.Slur \push #'direction = #1
     \property PianoStaff.connectArpeggios = ##t
     \property Voice.TextSpanner \pop #'type
+
+    %% Ghostview is ok, but xdvi shows a solid line
+    \property Voice.TextSpanner \push #'line-thickness = #2
+    \property Voice.TextSpanner \push #'dash-period = #0.5
+
     \property Voice.TextSpanner \push #'type = #"dotted-line"
     \property Voice.TextSpanner \push #'edge-height = #'(0 . 1.5)
-    \property Voice.TextSpanner \push #'edge-text = #'("8va " . "")
+    \property Voice.TextSpanner \push #'edge-text = #'("8 " . "")
+    % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \property Staff."c0-position" = #-13
+    % Get back
+    \context Voice 
+    \outputproperty #(make-text-checker "m.g.")
+           #'extra-offset = #'(-3 . -2)
+    % currently, this can't be (small) italic, because in the paperblock
+    % we set italic_magnifictation to get large italics.
     cis''''4^"m.g."\arpeggio \spanrequest \start "text"  (
 
 #ifndef FAKE_GRACE
@@ -84,12 +118,21 @@ treble = \context Voice=treble \notes\relative c''{
 
 #else % FAKE_GRACE 
 
+    \property Score.PaperColumn  \push #'space-factor = #0.6
+    \property Score.PaperColumn  \push #'to-musical-spacing-factor = #0.04
     \property Voice.NoteHead \push #'font-size = #-1
     \property Voice.Stem \push #'font-size = #-1
+    \property Voice.Stem \push #'length = #6
+    \property Voice.Stem \push #'beamed-lengths =
+        #(map (lambda (x) (* 1.25 x)) '(0.0 2.5 2.0 1.5))
+    \property Voice.Stem \push #'beamed-minimum-lengths =
+        #(map (lambda (x) (* 1.25 x)) '(0.0 1.5 1.25 1.0))
+
     \property Voice.Beam \push #'font-size = #-1
     \property Voice.TextScript \push #'font-size = #-1
+    \property Voice.Fingering \push #'font-size = #-1
     \property Voice.Slur \push #'font-size = #-1
-    \property Voice.LocalKey \push #'font-size = #-1
+    \property Staff.Accidentals \push #'font-size = #-1
     \property Voice.Beam \push #'space-function = #grace-beam-space-function
 
     )cis16
@@ -103,12 +146,17 @@ treble = \context Voice=treble \notes\relative c''{
 
     \property Voice.NoteHead \pop #'font-size
     \property Voice.Stem \pop #'font-size
+    \property Voice.Stem \pop #'length
+    \property Voice.Stem \pop #'beamed-lengths
+    \property Voice.Stem \pop #'beamed-minimum-lengths
     \property Voice.Beam \pop #'font-size
     \property Voice.TextScript \pop #'font-size
+    \property Voice.Fingering \pop #'font-size
     \property Voice.Slur \pop #'font-size
-    \property Voice.LocalKey \pop #'font-size
+    \property Staff.Accidentals \pop #'font-size
     \property Voice.Beam \pop #'space-function
-
+    \property Score.PaperColumn  \pop #'space-factor
+    \property Score.PaperColumn \pop #'to-musical-spacing-factor
 #endif % FAKE_GRACE
     
 
@@ -121,23 +169,23 @@ treble = \context Voice=treble \notes\relative c''{
 }
 
 trebleTwo = \context Voice=trebleTwo \notes\relative c''{
-    % Broken?
     \property Voice.NoteColumn \push #'horizontal-shift = #1
     s2
     s1*2
     s4
     \property Voice.Stem \pop #'direction
     \property Voice.Stem \push #'direction = #-1
-    <cis4\arpeggio a fis dis>
+    <cis'4\arpeggio a fis dis>
 
 #ifdef FAKE_GRACE
     s32*16
 #endif
 
     \property Voice.NoteColumn \push #'force-hshift = #-0.2
-    <e2 gis, e d>
-    %r8 cis4. d4 [<cis8-5-4( e,-1> <b-3 d,-1> |
-    r8 cis4. d4
+    <e,2 gis, e d!>
+    % Hmm s/r?
+    %r8 cis4. d4
+    s8 cis4. d4
     \property Voice.NoteColumn \pop #'force-hshift
     [<cis8( e,> <b-3 d,-1> |
     \property Voice.NoteColumn \push #'force-hshift = #-0.2
@@ -148,47 +196,55 @@ trebleTwo = \context Voice=trebleTwo \notes\relative c''{
 }
 
 bass = \context Voice=bass \notes\relative c{
-    \property Voice.Slur \pop #'details
-    \property Voice.Slur \push #'details =
-%        #'((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (beautiful . 1.0))
-        #'((height-limit . 6.0) (ratio . 0.333) (force-blowfit . 1.0) (beautiful . 0.1))
-    \property Voice.Slur \pop #'de-uglify-parameters
-    \property Voice.Slur \push #'de-uglify-parameters =
-%    #'(1.5  0.8  -2.0)
-    #'(2.4  0.8  4.0)
+    % Allow ugly slurs
+    \property Voice.Slur \push #'beautiful = #5.0
+    \property Voice.Slur \push #'attachment-offset = #'((0 . -3) . (0 . -6))
     \property Voice.Stem \pop #'direction
     \property Voice.Slur \push #'direction = #-1
     % huh, auto-beamer?
     r8. e,16-2( [<a8 a,> <b b,>] <cis4 cis,> |
     %2
+    % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \translator Staff=treble
+    % Get back
+    \context Voice 
     \property Voice.Stem \pop #'direction
     \property Voice.Stem \push #'direction = #-1
     \property Voice.slurEndAttachment = #'stem
     <)a''4\arpeggio eis cis> 
     %\stemboth
     \property Voice.slurEndAttachment = ##f
+    % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \translator Staff=bass
+    % Get back
+    \context Voice 
     \property Voice.Stem \pop #'direction
     \property Voice.Slur \pop #'y-free
     \property Voice.Slur \push #'y-free = #0.1
+    \property Voice.Slur \pop #'attachment-offset
+    \property Voice.Slur \push #'attachment-offset = #'((0 . -3) . (0 . -8))
     r8. cis,,16( <fis8 fis,> <gis gis,>
     %3
     \property Voice.Stem \pop #'length
     \property Voice.Stem \push #'length = #5
     <a4 a,>
+    % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \translator Staff=treble
+    % Get back
+    \context Voice 
     \property Voice.Stem \pop #'length
     \property Voice.Stem \pop #'direction
     \property Voice.Stem \push #'direction = #-1
     <)a'\arpeggio fis cis>
+    % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \translator Staff=bass
+    % Get back
+    \context Voice 
     \property Voice.Stem \pop #'direction
     r2
     %4
-    \property Voice.Slur \pop #'details
-    \property Voice.Slur \push #'details =
-        #'((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (beautiful . 0.5))
+    \property Voice.Slur \pop #'beautiful
+    \property Voice.Slur \pop #'attachment-offset
     \property Voice.Stem \pop #'direction
     \property Voice.Stem \push #'direction = #-1
     <b,,4 b,>
@@ -205,12 +261,28 @@ bass = \context Voice=bass \notes\relative c{
     %Hmm
     %\grace { s16 s s s s32 s s s s \clef bass; s }
     \clef bass;
+    \grace { <e,,,32( e,> } <)gis'2 e>
 #else
-    s4 s8 s32 s  s \clef bass; s
-#endif
+    s4 s8 s32 s  s \clef bass;
+    \property Score.PaperColumn  \push #'space-factor = #0.6
+    \property Score.PaperColumn  \push #'to-musical-spacing-factor = #0.1
+    \property Voice.NoteHead \push #'font-size = #-1
+    \property Voice.Stem \push #'font-size = #-1
+    \property Voice.Stem \push #'length = #6
+    \property Voice.Slur \push #'font-size = #-1
+    \property Voice.Slur \push #'attachment-offset = #'((-0.5 . 0) . (0.5 . 0))
+    <e,,,32( e,>
 
-    \grace { <e,,,32( e,> } <)gis'2 e>
-    %5%
+    \property Voice.NoteHead \pop #'font-size
+    \property Voice.Stem \pop #'font-size
+    \property Voice.Stem \pop #'length
+    \property Voice.Slur \pop #'font-size
+    \property Score.PaperColumn  \pop #'space-factor
+    \property Score.PaperColumn \pop #'to-musical-spacing-factor
+     <)gis'2 e>
+    \property Voice.Slur \pop #'attachment-offset
+#endif
+    %5
     \property Voice.Slur \pop #'direction
     \property Voice.Slur \push #'direction = #1
     a,8 [e'-5(<)a-2 cis-3>]
@@ -266,11 +338,14 @@ middleDynamics = \context Dynamics=middle \notes{
     s8 s4
 
     \outputproperty #(make-type-checker 'dynamic-interface) 
-           #'extra-offset = #'(0 . 3.5)
-    s1\mf-"a tempo"
-    s8
+           #'extra-offset = #'(0 . 4)
+    %s1\mf-"a tempo"
+    s2\mf-"a tempo" s4
+    \outputproperty #(make-type-checker 'crescendo-interface) 
+           #'extra-offset = #'(0.5 . -1)
+    s\> \!s8
     \outputproperty #(make-type-checker 'dynamic-interface) 
-           #'extra-offset = #'(-1 . 3.5)
+           #'extra-offset = #'(-1 . 4)
     s8\mf s4 s4 s8\> s32 s s \!s
 }
 
@@ -335,20 +410,22 @@ lowerDynamics = \context Dynamics=lower \notes{
        >
     >
     \paper {
+       %%BURP
+       magnification_italic = 1.;
        \translator {
            \ScoreContext
            TimeSignature \push #'style = #"C"
+           SpacingSpanner \push #'maximum-duration-for-spacing = #(make-moment 1 4)
+
+           \remove Bar_number_engraver;
         }
        \translator {
            \type "Engraver_group_engraver";
            \name Dynamics;
            \consists "Output_property_engraver";
            Generic_property_list = #generic-voice-properties
-           %Generic_property_list = #generic-lyrics-properties
            \consists "Property_engraver";
            DynamicsMinimumVerticalExtent = #(cons -3 -3)
-           %VerticalAlignment \push #'threshold = #'(8 . 8) 
-           %VerticalAlignment \push #'threshold = #'(10 . 10) 
            VerticalAlignment \push #'threshold = #'(9 . 9) 
 
            startSustain = #"Ped."
@@ -356,7 +433,6 @@ lowerDynamics = \context Dynamics=lower \notes{
            stopStartSustain = #"*Ped."
            startUnaChorda = #"una chorda"
            stopUnaChorda = #"tre chorde"
-           % should make separate lists for stopsustain and startsustain 
            
            \consists "Piano_pedal_engraver";
            \consists "Script_engraver";
@@ -364,25 +440,16 @@ lowerDynamics = \context Dynamics=lower \notes{
            \consists "Text_engraver";
            %GURGURGU, text is initialised using TextScript
            TextScript \push #'style = #"italic"
-           TextScript \push #'font-size = #2
+           %%% TextScript \push #'font-size = #2
 
            \consists "Skip_req_swallow_translator";
 
            \consistsend "Axis_group_engraver";
        }
 
-       \translator {
-           \VoiceContext
-           %TextScript \push #'style = #"italic"
-           %TextScript \push #'font-size = #3
-           TextScript \push #'size = #"Large"
-           TextScript \push #'font-size = #"Large"
-        }
        \translator {
            \PianoStaffContext
            \accepts Dynamics;
-           %VerticalAlignment \push #'threshold = #'(8 . 8) 
-           %VerticalAlignment \push #'threshold = #'(6 . 6)
            VerticalAlignment \push #'threshold = #'(7 . 7)
         }
        \translator {
diff --git a/input/test/markup.ly b/input/test/markup.ly
new file mode 100644 (file)
index 0000000..ccd03f1
--- /dev/null
@@ -0,0 +1,28 @@
+%
+% Test new font selection and scm text markup
+%
+
+\score{
+       \notes\relative c''{
+               \stemUp
+               a-"text"
+               b-\textscript #"texta"
+               c-\textscript #'(bold "textb")
+
+               d-\textscript #'(lines "one" "two" "three")
+               e-\textscript #'(lines (bold "one") 
+                 (rows "and" "there" "is" ((family . "number") "2"))
+                 (italic "three"))
+               f-\textscript #'(finger "3")
+               g-\textscript #'(music (named "noteheads-2"))
+       }
+       \paper{
+               linewidth = -1.\mm;
+               \translator{
+                       \ScoreContext
+                       TextScript \push #'font-family = #'roman
+                       TextScript \pop #'no-spacing-rods
+                       TextScript \push #'direction = #1
+               }
+       }
+}
index 254cf67f787571f08304debd00632b8e1847a197..d81ea7813cdeaa1d58ea31c889d80a5a5e3009fd 100644 (file)
@@ -14,6 +14,10 @@ HELP2MAN_EXECS = lilypond
 STEPMAKE_TEMPLATES= c++ executable po help2man
 
 include $(depth)/make/stepmake.make 
+
+default: 
+
+
 # force these: Make can't know these have to be generated in advance
 $(outdir)/my-lily-parser.o: $(outdir)/parser.hh
 $(outdir)/my-lily-lexer.o: $(outdir)/parser.hh
index 12c8683d78fa4e71b7cfd6b894f6c0103de6e655..ef4fc214bddb3f742cd556977a633134dd508500 100644 (file)
@@ -21,9 +21,9 @@ MAKE_SCHEME_CALLBACK(Align_interface,alignment_callback,2);
 SCM
 Align_interface::alignment_callback (SCM element_smob, SCM axis)
 {
-  Score_element * sun = unsmob_element (element_smob);
+  Score_element * me = unsmob_element (element_smob);
   Axis ax = (Axis )gh_scm2int (axis);
-  Score_element * par = sun->parent_l (ax);
+  Score_element * par = me->parent_l (ax);
   if (par && !to_boolean (par->get_elt_property ("alignment-done")))
     {
       Align_interface::do_side_processing (par, ax);
index 7f889715db65160949f5a82e6353340c98bb5082..68226226ab9aff93bb23194a029a2aef2c11b01f 100644 (file)
@@ -84,6 +84,7 @@ Arpeggio::brew_molecule (SCM smob)
 /*
   We have to do a callback, because brew_molecule () triggers a
   vertical alignment if it is cross-staff.
+  This callback also adds padding.
 */
 MAKE_SCHEME_CALLBACK(Arpeggio, width_callback,2);
 SCM
@@ -94,5 +95,5 @@ Arpeggio::width_callback (SCM smob, SCM axis)
   assert (a == X_AXIS);
   Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
 
-  return ly_interval2scm (arpeggio.extent (X_AXIS));
+  return ly_interval2scm (arpeggio.extent (X_AXIS) * 1.5);
 }
index 63b2632560b2a1b406b93272ab5eb9200107d6e4..4192fd0780b254741076798413283792eb10dab7 100644 (file)
@@ -178,13 +178,13 @@ Bar::before_line_breaking  (SCM smob)
 void
 Bar::set_interface (Score_element*me)
 {
-  me->set_interface (ly_symbol2scm ("bar-interface"));
+  me->set_interface (ly_symbol2scm ("bar-line-interface"));
 }
 
 bool
 Bar::has_interface (Score_element*m)
 {
-  return m && m->has_interface (ly_symbol2scm ("bar-interface"));
+  return m && m->has_interface (ly_symbol2scm ("bar-line-interface"));
 }
 
 
index 19650961e2ae420f7ee2967d483cab8b04a742fc..523de92f6be654189802e349ac5b6742e96407a8 100644 (file)
 #include "score-element.hh"
 #include "paper-column.hh"
 #include "line-of-score.hh"
-
-/*
-  TODO: move text lookup out of Chord_name
- */
-
-/*
-  word is roman text or property-styled text:
-   "text"
-   ("text" . property-alist)
- */
-Molecule
-Chord_name::ly_word2molecule (Score_element * me, SCM word, Real* x) 
-{
-  *x = 0;
-
-  SCM options_alist = SCM_EOL;
-  if (gh_pair_p (word))
-    {
-      options_alist = gh_cdr (word);
-      word = gh_car (word);
-    }
-
-  if (gh_string_p (word))
-    {
-      /*
-       UGH. Should read from font metric structure.
-      */
-      Real ex = me->lookup_l ()->text ("", "x",
-                                  me->paper_l ()).extent (Y_AXIS).length ();
-      Real em = me->lookup_l ()->text ("", "m",
-                                  me->paper_l ()).extent (X_AXIS).length ();
-
-      String w = ly_scm2string (word);
-
-      String style;
-      SCM s = scm_assoc (ly_symbol2scm ("style"), options_alist);
-      if (s != SCM_BOOL_F)
-       {
-         style = ly_scm2string (gh_cdr (s));
-       }
-
-      Offset offset;
-      int size = 0;
-      /*
-       urg, `type'
-      */
-      s = scm_assoc (ly_symbol2scm ("type"), options_alist);
-      if (s != SCM_BOOL_F && ly_scm2string (gh_cdr (s)) == "super")
-       {
-         Real super_y = ex / 2;
-         offset = Offset (0, super_y);
-         if (!size)
-           size = -2;
-       }
-
-      s = scm_assoc (ly_symbol2scm ("size"), options_alist);
-      if (s != SCM_BOOL_F)
-       {
-         size = gh_scm2int (gh_cdr (s));
-       }
-
-      s = scm_assoc (ly_symbol2scm ("offset"), options_alist);
-      if (s != SCM_BOOL_F)
-       {
-         // hmm
-         SCM o = gh_cdr (s);
-         if (gh_pair_p (o))
-           offset = Offset (0, gh_scm2double (gh_cdr (o))) * ex;
-         *x = gh_scm2double (gh_car (o)) * em;
-       }
-
-      Molecule mol;
-      s = scm_assoc (ly_symbol2scm ("font"), options_alist);
-      if (s != SCM_BOOL_F && ly_scm2string (gh_cdr (s)) == "feta")
-        mol = me->paper_l ()->lookup_l (size)->afm_find (w);
-      else
-       mol = me->paper_l ()->lookup_l (size)->text (style, w, me->paper_l ());
-
-      mol.translate (offset);
-      return mol;
-    }
-  return Molecule ();
-}
-
-/*
-  ;; text: list of word
-  ;; word: string + optional list of property
-  ;; property: align, kern, font (?), size
- */
-Molecule
-Chord_name::ly_text2molecule (Score_element * me, SCM text) 
-{
-  Molecule mol;
-  if (gh_list_p (text))
-    {
-      while (gh_cdr (text) != SCM_EOL)
-        {
-         Real x;
-         Molecule m = ly_word2molecule (me, gh_car (text), &x);
-         if (!m.empty_b ())
-           mol.add_at_edge (X_AXIS, RIGHT, m, x);
-         text = gh_cdr (text);
-       }
-      text = gh_car (text);
-    }  
-  Real x;
-  Molecule m = ly_word2molecule (me,text, &x);
-  if (!m.empty_b ())
-    mol.add_at_edge (X_AXIS, RIGHT, m, x);
-  return mol;
-}
+#include "staff-symbol-referencer.hh"
+#include "text-item.hh"
 
 MAKE_SCHEME_CALLBACK (Chord_name,after_line_breaking,1);
 SCM
@@ -169,5 +60,18 @@ Chord_name::brew_molecule (SCM smob)
   SCM func = me->get_elt_property (ly_symbol2scm ("chord-name-function"));
   SCM text = gh_call3 (func, style, pitches, gh_cons (inversion, bass));
 
-  return ly_text2molecule (me, text).create_scheme ();
+  SCM properties = gh_append2 (me->immutable_property_alist_,
+                              me->mutable_property_alist_);
+  Molecule mol = Text_item::text2molecule (me, text, properties);
+
+  SCM space =  me->get_elt_property ("word-space");
+  if (gh_number_p (space))
+    {
+      Molecule m;
+      m.set_empty (false);
+      mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (space)*
+                      Staff_symbol_referencer::staff_space (me));
+    }
+
+  return mol.create_scheme ();
 }
index 924ca2dec33b65fd6e7d150753e8bf69c0b5d417..904f20202a5b976ccde71767dc522c7d80b9a000 100644 (file)
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
-
-/*
-  Order elements top to bottom/left to right/right to left etc.
-
-
-  *******
-  
-  element properties
-
-  stacking-dir -- stack contents of elements in which direction ?
-
-  align-dir -- Which side to align? -1: left side, 0: centered (around
-    center_l_ if not nil, or around center of width), 1: right side
-
-  threshold -- (cons MIN MAX), where MIN and MAX are dimensions in
-    staffspace
-
-  alignment-done -- boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)
-
-  center-element -- element which will be at the center of the group
-    after aligning (when using
-    Align_interface::center_on_element). The center element should
-    have this object as a reference point.
-
-  elements -- to be aligned elements 
-
-  axes -- list of axis numbers. Should contain only one number.
-  
-  *******
-  
-  Reads the following from its elements
-  
-  
-  minimum-space --  (cons LEFT RIGHT)
-
-  extra-space -- (cons LEFT RIGHT)
-  
-*/
 struct Align_interface {
   DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis));
   static void do_side_processing (Score_element*,Axis a);
index 08c5a98c685f27a6a8f6e30594c31b17397fed93..d912c49615c3613384bad17619077857c845a409 100644 (file)
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
-/*
-  properties:
 
-  stems -- list of stem objects, corresponding to the notes that the
-  arp has to be before.  */
 class Arpeggio
 {
 public:
index 258ff65dc4ed4e41a2a9e1c1a095e413a9f5021a..3c4676b9899170b4ffabe07851231411f51059c5 100644 (file)
    added to ELT_L_ to ELT_L_.
 
    Properties:
-
-   axes -- list of axis (number) in which this group works
-
-   transparent -- an Axis_group is transparent by default
-
-   elements -- contains list of pointers to other elements
-
-   interfaces -- Axis_group is added to this list.
 */
 struct Axis_group_interface 
 {
index 11bc3d37040ac3b5f568688e31dc36cccada382f..ba926a0972d155ecae43e925e06a0ee6efb71c6d 100644 (file)
 
 
 
-/** a beam connects multiple stems.
-
-  Beam adjusts the stems its owns to make sure that they reach the
-  beam and that point in the correct direction (urg?)
-
-   elt_properties:
-   
-   y-position -- real  (position of left edge)
-
-   height -- real  (dy)
-
-
-   Read-only
-   =========
-   
-   flag-width-function --
-
-   damping -- amount of beam slope damping. (int)
-     should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
-
-   default-neutral-direction -- which direction to choose if we're in
-     the middle of the staff
-   
-   thickness -- weight of beams, in staffspace
-
-   space-function -- function of type multiplicity -> real (in staffspace)
-
-   beamed-stem-shorten --
-
-   height-quants --
-
-   vertical-position-quant-function --
-
-   dir-function --
-   
-   damping -- damping factor (real).
-
-   outer-stem-length-limit -- catch suspect beam slopes, set slope to zero if
-     outer stem is lengthened more than this (in staffspace)
-
-   slope-limit -- set slope to zero if slope is running away steeper than this.
-*/
 class Beam
 {
 public:
index 3e9d0d6c1d696c39bedd1ba3df763eccfed6feb8..75d65e7acec21e405d24686f52e29ead1bf1d707 100644 (file)
 
 #include "item.hh"
 
-/**
-   align breakable items (clef, bar, etc.)
-
-   Properties:
-
-   break-align-symbol -- the index in the spacing table (symbol) of
-   the to be aligned item.
-
-*/
 class Break_align_interface
 {
 public:
index b4825593ba5b38c0f07109fd6cafba1874ff3f0e..d0f620a2c4bc0e84eb7a7952f219fa97b4f231f6 100644 (file)
@@ -22,8 +22,6 @@ class Chord_name
 {
 public:
   DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
-  static Molecule ly_word2molecule (Score_element*, SCM scm, Real* x) ;
-  static Molecule ly_text2molecule (Score_element*, SCM scm) ;
   DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
 };
 
index bd59e6ee1da437aaa6c516abb47d614791991ab2..e5308818df54e2e9f66db78169f3d06c0c962304 100644 (file)
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-/**
-  Set a clef in a staff.
-
-  properties:
-
-  non-default -- not set because of existence of a bar?
-
-  change -- is this a change clef (smaller size)?
-
-  glyph -- a string determining what glyph is typeset
-  
- */
 struct Clef 
 {
   DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
index d700f5a34a50b08260ab27881d3be45e06910098..483ad4bff1244eed306c57f0edf9a4c1c087c993 100644 (file)
 
   * Make interface of this, similar to align-interface.
   
-  Properties:
-
-  elements -- (see Axis_group_interface)
-
-  merge-differently-dotted -- merge black noteheads with differing dot count.
-
-  horizontal-shift -- integer that identifies ranking of note-column for horizontal shifting.
-  
-  force-hshift -- amount of collision_note_width that overides automatic collision settings.
-  Read and removed from elements.
-
-  note-width -- unit for horizontal translation, measured in staff-space.
-  
 */
 class Collision                        // interface
 {
index 0fe05d839650f06c77675ebeaabae1079a5b01f6..c487894bc2c558198be4cc94f1433a771b7d7939 100644 (file)
@@ -12,9 +12,7 @@
 
 #include "lily-guile.hh"
 /**
-  The hairpin symbol. (cresc)
-
-  (normal spanner?)
+  The hairpin symbol. 
  */
 struct Crescendo
 {
index ea4ce9be63ecd2446ab14a7c409e97bc564b5ce6..075bf3fdc7c9645a931eb8567bdc5ca2e938bfb1 100644 (file)
 
 
 
-/**
-  The dots to go with a notehead/rest.  A separate class, since they
-  are a party in collision resolution.
-
-  properties:
-
-  dot-count -- number of dots.
-
-  
-  */
-class Dots                     // interface
+class Dots
 {
 public:
   DECLARE_SCHEME_CALLBACK(quantised_position_callback, (SCM element, SCM axis));
index 812a442e295d91cbb69f9c570c4a535bf6c9cbeb..e367a4dbc86c12275e097ed887064e92c464ab21 100644 (file)
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-/*
-  horizontal-space -- amount of space to add after a note (in staff-space)
- */
-
 class Grace_align_item
 {
 public:
index fba4ed4c263543c9bf62ba9d33bdf125a2d2b1ff..8d8b90f4835c01150c20871cc60c45927a1eeac9 100644 (file)
@@ -9,27 +9,6 @@
 
 #include "spanner.hh"
 
-/** 
-  centred hyphen 
-
-  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.
-
-properties:
-
-  thickness -- thickness of line (in stafflinethickness)
-
-  height -- vertical offset  (in staffspace)
-
-  minimum-length -- try to make the hyphens at least this long. Also works
-    as a scaling parameter for the length
-
-  word-space -- elongate left by this much (FIXME: cumbersome semantics)
-  
-  */
 struct Hyphen_spanner 
 {
 public:
index 706f65530fd915a26d922493c9bd5473b44ecc83..3f48ff410dba285f2260ef48828c9acd3a2ad34c 100644 (file)
 #include "lily-proto.hh"
 
 /**
-  A group of  accidentals.
 
-  Properties:
 
-  c0-position -- integer indicating the position of central C?
+  Properties:
 
-  old-accidentals -- list of (pitch, accidental) pairs
 
-  new-accidentals -- list of (pitch, accidental) pairs
  */
 struct Key_item
 {
index 88f48b2603669cce3f3c8d016f22d5e8c0843d28..80e47c21ac120d2f8b5525b45890ee71711eeb63 100644 (file)
@@ -42,7 +42,6 @@ public:
   static Molecule dashed_slur (Bezier, Real thick, Real dash) ;
   static Molecule blank (Box b) ;
   static Molecule filledbox (Box b) ;  
-  static Molecule text (String style, String text, Paper_def*) ;
 };
 Lookup* unsmob_lookup (SCM);
 #endif // LOOKUP_HH
index 0bcb9d2e8dbabde1ac3bc00c3b0a4e2f89ebbc95..902f8c507fb5c394071a38a5b2a71467054ae71a 100644 (file)
@@ -20,6 +20,12 @@ unsmob_ ## name ( SCM s)                     \
 return  CL::unsmob (s);                                \
 }
 
+#define IMPLEMENT_TYPE_P(CL, FUNCNAME)\
+void init_type_p_ ## CL ()\
+{\
+  scm_make_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\
+}\
+ADD_SCM_INIT_FUNC(init_type_p_ ## CL, init_type_p_ ## CL)
 
 #ifndef SCM_CELL_TYPE
 #define SCM_CELL_TYPE(X) SCM_CAR(X)
@@ -32,6 +38,15 @@ return  CL::unsmob (s);                              \
 
 #define IMPLEMENT_SIMPLE_SMOBS(CL)                             \
 long CL::smob_tag_;                                            \
+SCM                                                            \
+CL::smob_p (SCM s)                                             \
+{                                                              \
+  if (SCM_NIMP(s) && SCM_CELL_TYPE(s) == smob_tag_)            \
+    return SCM_BOOL_T;                                         \
+  else                                                         \
+    return SCM_BOOL_F;                                         \
+                                                               \
+}                                                              \
 void                                                           \
 CL::init_smobs ()                                              \
 {                                                              \
index 1204a3befc1c37d77221f23d9cc1fd4381db2c50..a8926002e86e5e1bdaeec3748f787dc0ede38904 100644 (file)
 
 #include "spanner.hh"
 
-/** 
-  simple extender line 
-
-  The extender is a simple line at the baseline of the lyric
-  that helps show the length of a melissima (tied/slurred note).
+/*
 
   Extenders must be entered manually for now.
 
   extend beond, lasting the whole duration of the melissima
   (as in MUP, urg).
 
-  Properties:
-  
-  word-space --
 
-  height -- in stafflinethickness
+ */
 
-  right-trim-amount --
-  
-  */
-class Lyric_extender // interface
+class Lyric_extender
 {
 public:
   Spanner*elt_l_;
index d516dbfd96d9d733cc3298436a5ba38d230afe8f..c53350773dc23de046f106351220194934c9a864 100644 (file)
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 #include "rod.hh"
-/*
-  properties:
 
-  columns -- list of paper-columns
-
- expand-limit -- int : max number of measures expanded in church rests
-
- minimum-width -- Real in staffspace
-
- padding -- staffspace
-*/
 class Multi_measure_rest
 {
 public:
index 6703c443bb90fc18a155cdca3dc9cd5ab181664f..0a2f95efb04a1984cd9437181d87f12e8ef4e732 100644 (file)
@@ -15,8 +15,6 @@
     NoteHead is a kind of RhythmicHead, see there.
 
   Read-only:
-  
-  style -- symbol that sets note head style
 */
 
 class Note_head 
index 5633cb0fb236e48d8845d0fc2d9b30045479b5ce..cc4778ddddfcff7b5b4d75cf92927bfc3c169460 100644 (file)
 #include "rod.hh"
 #include "spring.hh"
 
-/**
-   bounded-by-me -- list of elts.
-
-   shortest-starter-duration -- rational signifying shortest moment that starts here
-
-
-   Interfaces:
-
-   axis-group, spaceable-element.
-  */
-
 class Paper_column : public Item
 { 
 public:
index 051bdaf98990cc34f68a7bca629a9fa01b9fd444..f623aa3bfeb373c2e3dd3a73586c24cff7da8f34 100644 (file)
 
 #include "lily-guile.hh"
 
-/**
-   A pause.
-
-   See also Rhythmic_head, Staff_symbol_referencer.
-   
-   Read-only properties:
-
-   style -- string specifying glyph style
- */
 class  Rest
 {
 public:
index 50b1b87187f11a2265f8de8a608a9f937db047ed..1c222f873cb70ff52fadb1e647d160d4fdbbe6de 100644 (file)
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-/*
-  Properties
-  
-  dot -- reference to Dots object.
-
-  stem -- pointer to Stem object
-
-  Read-only
-
-  duration-log -- 2-log of the notehead duration
-
-*/
 class Rhythmic_head
 {
 public:
index db67e1914356c617c8552ed329b9edeb3b89100e..6c9cb6e5ed1de644ce086cb2b16d878e86e10bfc 100644 (file)
 #include "spanner.hh"
 #include "item.hh"
 
-
-
-
-
 /**
    Position victim object (ELT_L_) next to other objects (the support).
 
    side-support -- list of score elements
 
-   direction -- where to put the victim object (left or right?)
-
-   side-relative-direction -- if set: get the direction from a different object, and multiply by this.
-   
    direction-source -- in case side-relative-direction is set, where
-   to get the direction
+     to get the direction
 
-   minimum-space -- minimum distance that the victim should move
-   (after padding)
-
-   padding -- add this much extra space between victim and support
-
-   self-alignment-X -- real number: -1 = left aligned, 0 = center, 1
-     right-aligned in X direction.
-
-     Set to an element pointer, if you want that element to be the center. 
-     
-   self-alignment-Y -- like self-alignment-X but for Y axis
-   
    TODO: move  out unrelated callbacks.
 
    TODO: reduce number of methods.
-
 */
 struct Side_position
 {
index 797bdc321b41646ec1f41287c37b02b997dd661f..c788b68e0f07156a3ca89869c0c112b74cdf81f6 100644 (file)
 #include "rod.hh"
 
 /**
-
-   de-uglify-parameters -- list of 3 real constants. They define the
-     valid areas for the middle control points. Used in de_uglyfy.
-     They are a bit empirical.
-
-   details -- alist containing contaning a few magic constants.
-
-   note-columns -- list of elt pointers to note columns.
-
-   attachment -- cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where
-     both types may be alongside-stem, stem, head or loose-end
-   
-   direction -- up or down?
-
-   y-free -- ? 
-   
-   control-points --
-
-   
-   
-   Read-only
-   =========
-   
-   extremity-rules --
-
-   extremity-offset-alist --
-
-   thickness --
-
-   dash -- number representing the length of the dashes.
 */
 class Slur
 {
 public:
-  static void add_column (Score_element*me,Score_element*col);
-  DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
+  static void add_column (Score_element *me, Score_element *col);
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
   static void set_interface (Score_element*);
   static bool  has_interface (Score_element*);
-  static Array<Offset> get_encompass_offset_arr (Score_element*me) ;
-  static Bezier get_curve (Score_element*me) ;
-  static Direction get_default_dir (Score_element*me) ;
-  DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
-  DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
+  static Array<Offset> get_encompass_offset_arr (Score_element *me);
+  static Bezier get_curve (Score_element *me);
+  static Direction get_default_dir (Score_element *me);
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+
 private:  
   static Real get_first_notecolumn_y (Score_element *me, Direction dir);
   static Offset broken_trend_offset (Score_element *me, Direction dir);
-  static Offset get_attachment (Score_element*me,Direction dir, Score_element**common) ;
-  static void de_uglyfy (Score_element*me,Slur_bezier_bow* bb, Real default_height);
-  static void set_extremities (Score_element*me);
-  static void set_control_points (Score_element*me);
-  static Offset encompass_offset (Score_element*me,Score_element *col,Score_element**common);
+  static Offset get_attachment (Score_element *me,Direction dir, Score_element **common);
+  static void de_uglyfy (Score_element *me,Slur_bezier_bow* bb, Real default_height);
+  static void set_extremities (Score_element *me);
+  static void set_control_points (Score_element *me);
+  static void check_slope (Score_element *me);
+  static Offset encompass_offset (Score_element *me, Score_element *col, Score_element **common);
 };
 
 #endif // SLUR_HH
index c881c05ad6215d37244930c9f8f2be45613e9a07..3c46977016e7524ba27612e76686b42571acae45 100644 (file)
@@ -111,6 +111,7 @@ private:\
 public: \
        static SCM equal_p (SCM a, SCM b);\
        static CL * unsmob (SCM);\
+       static SCM smob_p (SCM);\
        static void init_smobs();                               \
 private:
 
index 577f8902e1f842329d02305697aa15f88abb59f7..03489cd81050c4b7ed2ba20001c1fe1be97a3012 100644 (file)
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-/*
-  properties :
-
-  minimum-distances -- list of rods (ie. (OBJ . DIST) pairs)
-
-  ideal-distances -- (OBJ . (DIST . STRENGTH)) pairs
-  
-  dir-list -- list of stem directions.
- */
 struct Spaceable_element
 {
   /// set a minimum distance
index f0f81dde7612c38c72117665dd79cede71db83ac..7f678043eee3b7d4a1e82af8f984540a9bfc0b85 100644 (file)
 
 #include "spanner.hh"
 
-/**
-   Read-only properties
-
-   maximum-duration-for-spacing -- rational: space as if a duration of
-     this type is available in this measure.
-
-
-   
-   Read properties from paper-column
-
-   dir-list -- list of stem directions
-
-   shortest-playing-duration -- duration of the shortest playing in that column.
-
-   shortest-starter-duration -- duration of the shortest notes that starts
-     exactly in that column.
-
-   contains-grace -- boolean. Used to widen entries for grace notes.
-
-   extra-space --  pair of distances
-
-   stretch-distance -- pair of distances
- */
 class Spacing_spanner
 {
 public:
index 9b942fada0974256aba43f60133d929e82584410..880eb0dba009dfcb02f65563c6a81bc1fe1441dd 100644 (file)
    This is a barline that is spanned across other bar lines.  This is
    the implementation of the long barlines that occur in orchestral
    score and other multi-staff music.
-
-   TODO: Is this usable for other stuff besides barlines? We only have
-   to span a Score_element.  Perhaps this can be used for large time
-   sigs?
 */
 class Span_bar
 {
index 5bcf6196a7e182f4b79e850f30a6c664b10999e0..ce78e12711198710727ac539dbf29bcc81a4f574 100644 (file)
@@ -13,9 +13,6 @@
 #include "lily-guile.hh"
 
 /**
-  This spanner draws the lines of a pstaff.
-  The bottom line is position 0.
-
   TODO: add stafflinethickness as parameter.
   */
 class Staff_symbol 
index 81ef981d10b128652a05d08c4bff109d964d7cdf..11fa9dda0c0bf90d4e89281201dc2d052ef8dc9e 100644 (file)
@@ -13,9 +13,6 @@
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
-/*
-  stem -- pointer to the stem object.
- */
 class Stem_tremolo
 {
 public:
diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh
new file mode 100644 (file)
index 0000000..507627b
--- /dev/null
@@ -0,0 +1,27 @@
+/*   
+  text-item.hh -- declare Text_item
+
+  source file of the GNU LilyPond music typesetter
+  
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#ifndef TEXT_ITEM
+#define TEXT_ITEM
+
+#include "lily-guile.hh"
+#include "molecule.hh"
+
+class Text_item
+{
+public:
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+  static Molecule text2molecule (Score_element *me, SCM text, SCM properties);
+  static Molecule string2molecule (Score_element *me, SCM text, SCM properties);
+  static Molecule markup_sentence2molecule (Score_element *me, SCM markup_sentence, SCM properties);
+  static Molecule lookup_character (Score_element *me, SCM font_name, SCM text);
+  static Molecule lookup_text (Score_element *me, SCM font_name, SCM char_name);
+};
+
+#endif /* TEXT_ITEM */
index a5553555a9fb2d5211b4319e358b98335d0f7d0f..7155dfbba86397d5f4c479ae829969bbc8546bae 100644 (file)
@@ -14,9 +14,6 @@
 #include "lily-proto.hh"
 
 
-/*
-  heads -- pair of element pointers, pointing to the two heads of the
-  tie.  */
 class Tie
 {
 public:
index 6bf3608531a04f26a21b1b9b78e7d525cc32402e..3619fe0e4cbc00e8eb3b4be2d57f104e3ffd887a 100644 (file)
 
 #include "spanner.hh"
 
-/** Volta bracket with number
-
-properties:
-
-bars -- list of barline ptrs.
-
-thickness -- in stafflinethickness
-
-height -- in staffspace 
-
+/** 
 */
 
 class Volta_spanner
index 62ad7fbb916c52c9ead74cba161b23784bee3172..bdfbd7c158cc881b2741a87bdc012055a7b2da58 100644 (file)
@@ -196,147 +196,6 @@ Lookup::frame (Box b, Real thick)
 }
 
 
-/*
-   TODO: THIS IS UGLY.
-   Since the user has direct access to TeX marcos,
-   that currently provide the  only way to do
-   font selection, accents etc,
-   we try some halfbaked attempt to detect this TeX trickery.
- */
-String
-sanitise_TeX_string (String text)
-{
-  int brace_count =0;
-  for (int i= 0; i < text.length_i (); i++)
-    {
-      if (text[i] == '\\')
-       continue;
-      
-      if (text[i] == '{')
-       brace_count ++;
-      else if (text[i] == '}')
-       brace_count --;
-    }
-  
-  if(brace_count)
-    {
-      warning (_f ("Non-matching braces in text `%s', adding braces", text.ch_C()));
-
-      if (brace_count < 0)
-       {
-         text = to_str ('{', -brace_count) + text;
-       }
-      else 
-       {
-         text = text + to_str ('}', brace_count);
-       }
-    }
-    
-  return text;
-}
-
-/**
-   TODO!
- */
-String
-sanitise_PS_string (String t)
-{
-  return t;
-}
-
-/**
-TODO: move into Text_item. UGH: paper_l argument shoudl be junked.
-*/
-Molecule
-Lookup::text (String style, String text, Paper_def *paper_l) 
-{
-  if (style.empty_b ())
-    style = "roman";
-  
-  int font_mag = 0;
-  Real font_h = paper_l->get_var ("font_normal");
-  if (paper_l->scope_p_->elem_b ("font_" + style))
-    {
-      font_h = paper_l->get_var ("font_" + style);
-    }
-
-
-  if (paper_l->scope_p_->elem_b ("magnification_" + style))
-    {
-      font_mag = (int)paper_l->get_var ("magnification_" + style);
-    }
-
-  /*
-    FIXME !
-   */
-  
-  SCM l = scm_assoc (ly_str02scm (style.ch_C()),
-                    scm_eval2 (ly_symbol2scm ("cmr-alist"), SCM_EOL));
-
-  if (l != SCM_BOOL_F)
-    {
-      style = ly_scm2string (gh_cdr(l)) +to_str  ((int)font_h);
-    }
-
-  Font_metric* metric_l = 0;
-
-  if (font_mag)
-    metric_l = all_fonts_global_p->find_scaled (style, font_mag);
-  else
-    metric_l = all_fonts_global_p->find_font (style);
-  
-  
-    
-
-  int i = text.index_i ("\\n");
-  while (i >=0 )
-    {
-      text = text.left_str (i) + "\n" + text.right_str (text.length_i () - i - 2);
-      i = text.index_i ("\\n");
-    }
-  
-  Array<String> lines = String_convert::split_arr (text, '\n');
-  
-  Real kern = paper_l->get_var ("line_kern");
-  
-  for (int i=0; i < lines.size (); i++)
-    {
-      String str (lines[i]);
-      if (output_global_ch == "tex")
-       str = sanitise_TeX_string  (str);
-      else if (output_global_ch == "ps")
-       str = sanitise_PS_string (str);
-      lines[i] = str;
-    }
-
-  if (!lines.size())
-       return Molecule();
-
-  SCM first = gh_list (ly_symbol2scm ("text"),
-                        ly_str02scm (lines[0].ch_C()),
-                        SCM_UNDEFINED);
-  first = fontify_atom (metric_l, first);
-
-  
-
-  Molecule mol (metric_l->text_dimension (lines[0]), first);
-
-  for (i = 1; i < lines.size (); i++)
-    {
-      SCM line = (gh_list (ly_symbol2scm ("text"),
-                          ly_str02scm (lines[i].ch_C ()),
-                          SCM_UNDEFINED));
-      line = fontify_atom (metric_l, line);
-      mol.add_at_edge (Y_AXIS, DOWN,
-                      Molecule (metric_l->text_dimension (lines[i]), line),
-                      kern);
-    }
-
-  return mol;
-}
-  
-
-
 /*
   Make a smooth curve along the points 
  */
index eeada948563860f7cb47457961907211068c121a..629870d6c305b511d608c47ada812309936fc383 100644 (file)
@@ -67,7 +67,8 @@ void
 Mark_engraver::acknowledge_element (Score_element_info inf)
 {
   Score_element * s = inf.elem_l_;
-  if (Staff_symbol::has_interface (s))
+  if (Staff_symbol::has_interface (s)
+      || to_boolean (s->get_elt_property ("invisible-staff")))
     {
       SCM sts = get_property ("staffsFound");
       SCM thisstaff = inf.elem_l_->self_scm ();
index 9806910b55a382b1058f82847f92e47099260c8a..bf1bef9b961651b64ab18e5ed5ee114d3a58c23b 100644 (file)
@@ -35,7 +35,8 @@ Midi_item::midi_p (Audio_item* a)
   else if (Audio_time_signature* i = dynamic_cast<Audio_time_signature*> (a))
     return new Midi_time_signature (i);
   else if (Audio_text* i = dynamic_cast<Audio_text*> (a))
-    return i->text_str_.length_i () ? new Midi_text (i) : 0;
+    //return i->text_str_.length_i () ? new Midi_text (i) : 0;
+    return new Midi_text (i);
   else
     assert (0);
 
@@ -535,15 +536,6 @@ Midi_text::Midi_text (Audio_text* a)
   audio_l_ = a;
 }
 
-#if 0
-Midi_text::Midi_text (Midi_text::Type type, String text_str)
-  : Audio_text ()
-{
-  text_str_ = text_str;
-  type_ = type;
-}
-#endif
-
 String
 Midi_text::str () const
 {
index c3ebbf02c9028f252210701d462d6b7b4cf94e28..ff21fb5ebffbf6f5a3a9befe24a4da8bdcc6c41c 100644 (file)
@@ -15,7 +15,7 @@
 
 IMPLEMENT_UNSMOB(Moment,moment);
 IMPLEMENT_SIMPLE_SMOBS(Moment);
-
+IMPLEMENT_TYPE_P (Moment, "moment?");
 
 SCM
 Moment::mark_smob (SCM)
@@ -67,6 +67,7 @@ void
 init_moments ()
 {
   scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational);
+  scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational);  
 }
 
 ADD_SCM_INIT_FUNC(moms,init_moments);
index fbe8996a31c5529c18a05991b01104c15d00f0a6..b572aa9b1452a95f044b1de935bd89914d56a283 100644 (file)
@@ -18,6 +18,7 @@
 #include "group-interface.hh"
 #include "spanner.hh"
 #include "staff-symbol-referencer.hh"
+#include "text-item.hh"
 
 void
 Multi_measure_rest::set_interface (Score_element*me)
@@ -130,7 +131,12 @@ Multi_measure_rest::brew_molecule (SCM smob)
 
   if (measures > 1)
     {
-      Molecule s (me->lookup_l ()->text ("number", to_str (measures), me->paper_l ()));
+      SCM properties = gh_append2 (me->immutable_property_alist_,
+                                  me->mutable_property_alist_);
+      Molecule s =
+       Text_item::text2molecule (me,
+                                 ly_str02scm (to_str (measures).ch_C ()),
+                                 properties);
       s.align_to (X_AXIS, CENTER);
       s.translate_axis (3.0 * staff_space, Y_AXIS);
       mol.add_molecule (s);
index c85b0a398e3b66f2ca2ac41e56452279384e5ce9..1f0033f86f2383adfe9780dab2a3fcf01f26ba7b 100644 (file)
@@ -43,6 +43,8 @@ static Keyword_ent the_key_tab[]={
   {"context", CONTEXT},
   {"denies", DENIES},
   {"duration", DURATION},
+  {"dynamicscript", DYNAMICSCRIPT},
+  {"elementdescriptions", ELEMENTDESCRIPTIONS},
   {"font", FONT},
   {"grace", GRACE},
   {"header", HEADER},
index a19df5c7d0807c352af97dfb4b63b27c1a6c0daf..4a4c59d60da5972de8767809233786472562ac12 100644 (file)
@@ -84,6 +84,11 @@ Score_element::Score_element(SCM basicprops)
     
     dim_cache_[a].dimension_ = cb;
   }
+
+  SCM meta = get_elt_property ("meta");
+  SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
+  
+  set_elt_property ("interfaces",gh_cdr (ifs));
 }
 
 
@@ -605,6 +610,9 @@ Score_element::extent (Score_element * refp, Axis a) const
   else
     return ext;
 
+  if (!gh_pair_p (d->dimension_))
+    return ext;
+  
   ext = ly_scm2interval (d->dimension_);
 
   SCM extra = get_elt_property (a == X_AXIS
@@ -675,9 +683,10 @@ Score_element::common_refpoint (SCM elist, Axis a) const
 String
 Score_element::name () const
 {
-  SCM nm = get_elt_property ("name");
-  
-  return  nm == SCM_EOL ? classname (this) :ly_scm2string (nm) ;  
+  SCM meta = get_elt_property ("meta");
+  SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
+  nm =  (gh_pair_p (nm)) ? gh_cdr (nm) : SCM_EOL;
+  return  gh_string_p (nm) ?ly_scm2string (nm) :  classname (this);  
 }
 
 void
@@ -878,7 +887,7 @@ static void
 init_functions ()
 {
   interfaces_sym = scm_permanent_object (ly_symbol2scm ("interfaces"));
-  
+
   scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (Scheme_function_unknown)ly_get_elt_property);
   scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (Scheme_function_unknown)ly_set_elt_property);
   scm_make_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound);
@@ -906,4 +915,4 @@ Score_element::set_interface (SCM k)
 
 
 ADD_SCM_INIT_FUNC(scoreelt, init_functions);
-
+IMPLEMENT_TYPE_P(Score_element, "ly-element?");
index cb3577a163adb7f0c0997bed54d817afcf0d1021..187f1b689ab08c8d4c4bbd5a8f1b601d465c8f4d 100644 (file)
@@ -32,8 +32,8 @@ Score_engraver::prepare (Moment w)
 {
   Global_translator::prepare (w);
 
-  SCM props = get_property (ly_symbol2scm ("PaperColumn"));
-  set_columns (new Paper_column (props),  new Paper_column (props));
+  set_columns (new Paper_column (get_property (ly_symbol2scm ("NonMusicalPaperColumn"))),
+              new Paper_column (get_property (ly_symbol2scm ("PaperColumn"))));
   
   command_column_l_->set_elt_property ("when", w.make_scm());
   musical_column_l_->set_elt_property ("when", w.make_scm());
index 38d163fde7e562c2c1fcc9e313cb53fb02743cb0..1ac4b5cf79513bcecd10db8476306770189b170d 100644 (file)
@@ -11,7 +11,6 @@
   [TODO]
     * fix broken interstaff slurs
     * begin and end should be treated as a/acknowledge Scripts.
-    * broken slur should have uniform trend
     * smart changing of endings
     * smart changing of (Y-?)offsets to avoid ugly beziers
        (along-side-stem)
@@ -122,11 +121,53 @@ Slur::after_line_breaking (SCM smob)
   return SCM_UNSPECIFIED;
 } 
 
+
 void
-Slur::set_extremities (Score_element*me)
+Slur::check_slope (Score_element *me)
+{
+  /*
+    Avoid too steep slurs.
+   */
+  SCM s = me->get_elt_property ("slope-limit");
+  if (gh_number_p (s))
+    {
+      Array<Offset> encompass = get_encompass_offset_arr (me);
+      Drul_array<Offset> attachment;
+      attachment[LEFT] = encompass[0];
+      attachment[RIGHT] = encompass.top ();
+
+      Real dx = attachment[RIGHT][X_AXIS] - attachment[LEFT][X_AXIS];
+      Real dy = attachment[RIGHT][Y_AXIS] - attachment[LEFT][Y_AXIS];
+      if (!dx)
+       return;
+      
+      Real slope = slope = abs (dy / dx);
+
+      Real limit = gh_scm2double (s);
+
+      if (slope > limit)
+       {
+         Real staff_space = Staff_symbol_referencer::staff_space ((Score_element*)me);
+         Direction dir = (Direction)gh_scm2int (me->get_elt_property ("direction"));
+         Direction d = (Direction)(- dir * (sign (dy)));
+         SCM a = me->get_elt_property ("attachment-offset");
+         Drul_array<Offset> o;
+         o[LEFT] = ly_scm2offset (index_cell (a, LEFT));
+         o[RIGHT] = ly_scm2offset (index_cell (a, RIGHT));
+         o[d][Y_AXIS] -= (limit - slope) * dx * dir / staff_space;
+         //o[d][Y_AXIS] = attachment[-d][Y_AXIS] + (dx * limit * dir / staff_space);
+         me->set_elt_property ("attachment-offset",
+                               gh_cons (ly_offset2scm (o[LEFT]),
+                                        ly_offset2scm (o[RIGHT])));
+       }
+    }
+}
+
+void
+Slur::set_extremities (Score_element *me)
 {
   if (!Directional_element_interface::get (me))
-    Directional_element_interface ::set (me,get_default_dir (me));
+    Directional_element_interface::set (me, get_default_dir (me));
 
   Direction dir = LEFT;
   do 
@@ -148,8 +189,11 @@ Slur::set_extremities (Score_element*me)
        }
     }
   while (flip (&dir) != LEFT);
+
+  check_slope (me);
 }
 
+
 Real
 Slur::get_first_notecolumn_y (Score_element *me, Direction dir)
 {
@@ -199,7 +243,10 @@ Slur::broken_trend_offset (Score_element *me, Direction dir)
                                             me->get_elt_property ("direction"));
              Real neighbour_y = get_first_notecolumn_y (neighbour, dir);
              Real y = get_first_notecolumn_y (me, -dir);
-             o = Offset (0, (y + neighbour_y) / 2);
+             int neighbour_cols = scm_ilength (neighbour->get_elt_property ("note-columns"));
+             int cols = scm_ilength (me->get_elt_property ("note-columns"));
+             o = Offset (0, (y*neighbour_cols + neighbour_y*cols) /
+                         (cols + neighbour_cols));
              break;
            }
        }
@@ -208,7 +255,7 @@ Slur::broken_trend_offset (Score_element *me, Direction dir)
 }
 
 Offset
-Slur::get_attachment (Score_element*me,Direction dir,
+Slur::get_attachment (Score_element *me, Direction dir,
                      Score_element **common) 
 {
   SCM s = me->get_elt_property ("attachment");
@@ -220,8 +267,8 @@ Slur::get_attachment (Score_element*me,Direction dir,
   SCM a = dir == LEFT ? gh_car (s) : gh_cdr (s);
   Spanner*sp = dynamic_cast<Spanner*>(me);
   String str = ly_symbol2string (a);
-  Real ss = Staff_symbol_referencer::staff_space ((Score_element*)me);
-  Real hs = ss / 2.0;
+  Real staff_space = Staff_symbol_referencer::staff_space ((Score_element*)me);
+  Real hs = staff_space / 2.0;
   Offset o;
   
   Score_element *stem = 0;
@@ -239,7 +286,8 @@ Slur::get_attachment (Score_element*me,Direction dir,
                Default position is centered in X, on outer side of head Y
               */
              o += Offset (0.5 * n->extent (n,X_AXIS).length (),
-                          0.5 * ss * Directional_element_interface::get (me));
+                          0.5 * staff_space
+                          * Directional_element_interface::get (me));
            }
          else if (str == "alongside-stem")
            {
@@ -249,7 +297,8 @@ Slur::get_attachment (Score_element*me,Direction dir,
               */
              o += Offset (n->extent (n,X_AXIS).length ()
                           * (1 + Stem::get_direction (stem)),
-                          0.5 * ss * Directional_element_interface::get (me));
+                          0.5 * staff_space
+                          * Directional_element_interface::get (me));
            }
          else if (str == "stem")
            {
@@ -295,7 +344,7 @@ int stemdir = stem ? Stem::get_direction (stem) : 1;
 
   if (l != SCM_BOOL_F)
     {
-      o += ly_scm2offset (gh_cdr (l)) * ss * dir;
+      o += ly_scm2offset (gh_cdr (l)) * staff_space * dir;
     }
 
   /*
@@ -308,6 +357,8 @@ int stemdir = stem ? Stem::get_direction (stem) : 1;
        - me->relative_coordinate (common[Y_AXIS], Y_AXIS);
     }
 
+  o += ly_scm2offset (index_cell (me->get_elt_property ("attachment-offset"),
+                                 dir)) * staff_space;
   return o;
 }
 
@@ -356,12 +407,12 @@ Slur::encompass_offset (Score_element*me,
 }
 
 Array<Offset>
-Slur::get_encompass_offset_arr (Score_element*me) 
+Slur::get_encompass_offset_arr (Score_element *me)
 {
   Spanner*sp = dynamic_cast<Spanner*>(me);
   SCM eltlist = me->get_elt_property ("note-columns");
-  Score_element *common[] = {me->common_refpoint (eltlist,X_AXIS),
-                            me->common_refpoint (eltlist,Y_AXIS)};
+  Score_element *common[] = {me->common_refpoint (eltlist, X_AXIS),
+                            me->common_refpoint (eltlist, Y_AXIS)};
 
 
   common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
@@ -498,8 +549,10 @@ Slur::set_control_points (Score_element*me)
       Real length = bb.curve_.control_[3][X_AXIS]; 
       Real default_height = slur_height (length, h_inf, r_0);
 
-      SCM ssb = scm_assq (ly_symbol2scm ("beautiful"), details);
-      Real sb =gh_scm2double (gh_cdr (ssb));
+      SCM ssb = me->get_elt_property ("beautiful");
+      Real sb = 0;
+      if (gh_number_p (ssb))
+       sb = gh_scm2double (ssb);
 
       bb.minimise_enclosed_area (me->paper_l(), sb);
       SCM sbf = scm_assq (ly_symbol2scm ("force-blowfit"), details);
index 37cac89a5e29e8a316c4bc4461241b0bbe7b59a3..f2478b56c4c728882397bc89f8a554aa641f69d1 100644 (file)
@@ -78,4 +78,5 @@ Spaceable_element::remove_interface (Score_element*me)
 void
 Spaceable_element::set_interface (Score_element*me)
 {
+  me->set_interface (ly_symbol2scm ("spaceable-element-interface"));
 }
index a1f329fc37a59267e37226ddf603b046df90194f..c5b306092a74d5b26ded8c9fc9b02238cbb73ea6 100644 (file)
@@ -75,6 +75,18 @@ Spacing_spanner::do_measure (Score_element*me, Link_array<Score_element> cols)
 
       Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}};
 
+
+      /*
+       left refers to the space that is associated with items of the left column, so you have
+
+         LC  <- left_space -><- right_space -> RC
+              <-    total space              ->
+             
+
+        typically, right_space is non-zero when there are
+        accidentals in RC
+         
+       */
       for (int j=0; j < 4; j++)
        {
          Paper_column * lc = dynamic_cast<Paper_column*> (combinations[j][0]);
@@ -115,10 +127,11 @@ Spacing_spanner::do_measure (Score_element*me, Link_array<Score_element> cols)
            We want the space before barline to be like the note
            spacing in the measure.
          */
+         SCM sfac =lc->get_elt_property ("space-factor");
          if (Item::breakable_b (lc) || lc->original_l_)
-           s.strength_f_ = non_musical_space_strength;
-         else if (!lc->musical_b ())
-           left_distance *= me->paper_l ()->get_var ("decrease_nonmus_spacing_factor");
+           s.strength_f_ =  non_musical_space_strength;
+         else if (gh_number_p (sfac))
+           left_distance *= gh_scm2double (sfac);
 
          
          Real right_dist = 0.0;
@@ -135,15 +148,14 @@ Spacing_spanner::do_measure (Score_element*me, Link_array<Score_element> cols)
          /*
            don't want to create too much extra space for accidentals
          */
-         if (lc->musical_b () && rc->musical_b ())
-           {
-             if (!to_boolean (rc->get_elt_property ("contains-grace")))
-               right_dist *= me->paper_l ()->get_var ("musical_to_musical_left_spacing_factor");
-           }
+         if (rc->musical_b ())
+          {
+             if (to_boolean (rc->get_elt_property ("contains-grace")))
+               right_dist *= me->paper_l ()->get_var ("before_grace_spacing_factor"); // fixme.
+             else
+               right_dist *= gh_scm2double (lc->get_elt_property ("before-musical-spacing-factor"));
+          }
 
-         if (rc->musical_b () && to_boolean (rc->get_elt_property ("contains-grace")))
-           right_dist *= me->paper_l ()->get_var ("before_grace_spacing_factor");
          s.distance_f_ = left_distance + right_dist;
            
          Real stretch_dist = 0.;
index 5ae4d1295d5dad78283ab0b245cda19c98836d53..d90b51df2479c92d4e9dd7e614d5e8f824558f02 100644 (file)
@@ -10,7 +10,6 @@
 #include "lily-guile.hh"
 #include "item.hh"
 #include "arpeggio.hh"
-#include "span-arpeggio.hh"
 #include "group-interface.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
index feca94f8845ef460a56e1ffec8d37189e196ef10..2d8f9bbe22d334a348c4d7018f65c731e2989f2f 100644 (file)
 
   source file of the GNU LilyPond music typesetter
   
 (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Jan Nieuwenhuizen <janneke@gnu.org>
  */
 
 #include "debug.hh"
-#include "molecule.hh"
+#include "text-item.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
+#include "staff-symbol-referencer.hh"
+#include "main.hh"
+#include "all-font-metrics.hh"
+#include "afm.hh"
+
+/*
+  text: string | (markup sentence)
+  markup: markup-symbol | (markup-symbol . parameter)
+  sentence: text | sentence text
+  
+
+  Properties:
+
+  * Font:
+  ---* Type:
+  ------* Series: medium, bold
+  ------* Shape: upright, italic, slanted
+  ------* Family: roman, music, orator, typewriter
+
+  ---* Size:
+  ------* size: ...,-2,-1,0,1,2,... (style-sheet -> cmrXX, fetaXX)
+  ------* points: 11,13,16,20,23,26 (for feta)
+  ------* magnification: UNSIGNED
+
+  * Typesetting:
+  ---* kern: INT (staff-space)
+  ---* align: horizontal/vertical / lines / rows
+ */
+Molecule
+Text_item::text2molecule (Score_element *me, SCM text, SCM properties) 
+{
+  if (gh_string_p (text))
+    return string2molecule (me, text, properties);
+  else if (gh_list_p (text))
+    {
+      if (!gh_pair_p (gh_car (text)) && gh_string_p (gh_car (text)))
+       return string2molecule (me, gh_car (text), properties);
+      else
+       return markup_sentence2molecule (me, text, properties);
+    }
+  return Molecule ();
+}
+
+static
+SCM
+get_elt_property (Score_element *me, char const *name)
+{
+  SCM s = me->get_elt_property (name);
+  if (s == SCM_EOL)
+    error (_f ("No `%s' defined for %s", name, me->name ()));
+  return s;
+}
+
+Molecule
+Text_item::string2molecule (Score_element *me, SCM text, SCM properties)
+{
+  SCM style = scm_assoc (ly_symbol2scm ("font-style"), properties);
+  SCM paper = me->get_elt_property ("style-sheet");
+  if (paper == SCM_EOL)
+    paper = scm_string_to_symbol (me->paper_l ()->get_scmvar ("style_sheet"));
+
+  SCM font_name;
+  if (gh_pair_p (style))
+    {
+      SCM f = get_elt_property (me, "style-to-font-name");
+      font_name = gh_call2 (f, paper, gh_cdr (style));
+    }
+  else
+    {
+      SCM f = get_elt_property (me, "properties-to-font-name");
+      font_name = gh_call2 (f, paper, properties);
+    }
+   
+  // should move fallback to scm
+  if (!gh_string_p (font_name))
+    font_name = ly_str02scm ("cmr10");
+    
+  SCM lookup = scm_assoc (ly_symbol2scm ("lookup"), properties);
+
+  Molecule mol;
+  if (gh_pair_p (lookup) && ly_symbol2string (gh_cdr (lookup)) == "name")
+    mol = lookup_character (me, font_name, text);
+  else
+    mol = lookup_text (me, font_name, text);
+  
+  return mol;
+}
 
-struct Text_item
+/*
+  caching / use some form of Lookup without 'paper'?
+*/
+Molecule
+Text_item::lookup_character (Score_element *me, SCM font_name, SCM char_name)
 {
-  DECLARE_SCHEME_CALLBACK( brew_molecule, (SCM));
-};
+  Adobe_font_metric *afm = all_fonts_global_p->find_afm (ly_scm2string (font_name));
 
+  if (!afm)
+    {
+      warning (_f ("can't find font: `%s'", ly_scm2string (font_name)));
+      warning (_f ("(search path: `%s')", global_path.str ().ch_C()));
+      error (_ ("Aborting"));
+    }
+  
+  AFM_CharMetricInfo const *metric =
+    afm->find_char_metric (ly_scm2string (char_name), true);
 
-MAKE_SCHEME_CALLBACK(Text_item,brew_molecule,1);
+  if (!metric)
+    {
+      Molecule m;
+      m.set_empty (false);
+      return m;
+    }
+
+  SCM list = gh_list (ly_symbol2scm ("char"),
+                     gh_int2scm (metric->code),
+                     SCM_UNDEFINED);
+  
+  list = fontify_atom (afm, list);
+  return Molecule (afm_bbox_to_box (metric->charBBox), list);
+}
 
+Molecule
+Text_item::lookup_text (Score_element *me, SCM font_name, SCM text)
+{
+  SCM magnification = me->get_elt_property ("font-magnification");
+  Font_metric* metric = 0;
+  if (gh_number_p (magnification))
+    metric = all_fonts_global_p->find_scaled (ly_scm2string (font_name),
+                                             gh_scm2int (magnification));
+  else
+    metric = all_fonts_global_p->find_font (ly_scm2string (font_name));
+  
+  SCM list = gh_list (ly_symbol2scm ("text"), text, SCM_UNDEFINED);
+  list = fontify_atom (metric, list);
+  
+  return Molecule (metric->text_dimension (ly_scm2string (text)), list);
+}
+
+Molecule
+Text_item::markup_sentence2molecule (Score_element *me, SCM markup_sentence,
+                                    SCM properties)
+{
+  SCM markup = gh_car (markup_sentence);
+  SCM sentence = gh_cdr (markup_sentence);
+  SCM f = get_elt_property (me, "markup-to-properties");
+  SCM p = gh_cons (gh_call1 (f, markup), properties);
+
+  Axis align = X_AXIS;
+  SCM a = scm_assoc (ly_symbol2scm ("align"), p);
+  if (gh_pair_p (a) && gh_number_p (gh_cdr (a)))
+    align = (Axis)gh_scm2int (gh_cdr (a));
+
+  Molecule mol;
+  while (gh_pair_p (sentence))
+    {
+      Molecule m = text2molecule (me, gh_car (sentence), p);
+      if (!m.empty_b ())
+       mol.add_at_edge (align, align == X_AXIS ? RIGHT : DOWN, m, 0);
+      sentence = gh_cdr (sentence);
+    }
+  return mol;
+}
+
+MAKE_SCHEME_CALLBACK (Text_item, brew_molecule, 1);
 SCM 
-Text_item::brew_molecule (SCM sm
+Text_item::brew_molecule (SCM smob)
 {
-  Score_element * s = unsmob_element (sm);
+  Score_element *me = unsmob_element (smob);
   
-  SCM style = s->get_elt_property ("style");
-  String st = gh_string_p (style) ?  ly_scm2string (style) : "";
-  SCM txt = s-> get_elt_property ("text");
-  String t = gh_string_p (txt) ? ly_scm2string (txt) : "";
+  SCM text = me->get_elt_property ("text");
+
+  SCM properties = gh_append2 (me->immutable_property_alist_,
+                              me->mutable_property_alist_);
 
-  Molecule mol =  s->paper_l ()->lookup_l(0)->text (st, t, s->paper_l ());
+  Molecule mol = Text_item::text2molecule (me, text, properties);
 
-  SCM space =  s->get_elt_property ("word-space");
+  SCM space = me->get_elt_property ("word-space");
   if (gh_number_p (space))
     {
       Molecule m;
       m.set_empty (false);
-      mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (space)*
-                      Staff_symbol_referencer::staff_space (s));
+      mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (space)
+                      * Staff_symbol_referencer::staff_space (me));
     }
   return mol.create_scheme (); 
 }
 
-
index 4b658b0a5bc4931ccf3df873a6e92275c39db0f4..cfd1bd292fecabd81a96106eca9ffeaef7c705f7 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include "molecule.hh"
+#include "text-item.hh"
 #include "text-spanner.hh"
 #include "spanner.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 
 /*
-  Generic Text spanner:
-
-  type: "line", "dashed-line", "dotted-line"
-  edge-text: ("le" . "re")
-  text-style: "italic"
-  egde-height: (lh . rh)
-
-  "le"--------------"re"
-                    |^ 
-                    |v rh
-
-  fine tuning:
-
-  dash-period 
-  dash-length 
-  line-thickness
-
   TODO:
     - vertical start / vertical end (fixme-name) |
     - contination types (vert. star, vert. end)  |-> eat volta-spanner
@@ -63,11 +47,16 @@ Text_spanner::brew_molecule (SCM smob)
     }
   while (flip (&d) != LEFT);
   
+#if 0
   SCM s = me->get_elt_property ("text-style");
+
   String text_style = "italic";
   if (gh_string_p (s))
     text_style = ly_scm2string (s);
+#endif
+
+  SCM properties = gh_append2 (me->immutable_property_alist_,
+                              me->mutable_property_alist_);
   SCM edge_text = me->get_elt_property ("edge-text");
   Drul_array<Molecule> edge;
   if (gh_pair_p (edge_text))
@@ -75,8 +64,8 @@ Text_spanner::brew_molecule (SCM smob)
       Direction d = LEFT;
       do
        {
-         String text = ly_scm2string (index_cell (edge_text, d));
-         edge[d] = me->lookup_l ()->text (text_style, text, me->paper_l ());
+         SCM text = index_cell (edge_text, d);
+         edge[d] = Text_item::text2molecule (me, text, properties);
          if (!edge[d].empty_b ())
            edge[d].align_to (Y_AXIS, CENTER);
        }
@@ -87,7 +76,7 @@ Text_spanner::brew_molecule (SCM smob)
   shorten[LEFT] = 0;
   shorten[RIGHT] = 0;
 
-  s = me->get_elt_property ("shorten");
+  SCM s = me->get_elt_property ("shorten");
   if (gh_pair_p (s))
     {
       shorten[LEFT] = gh_scm2double (gh_car (s)) * staff_space;
@@ -161,7 +150,7 @@ Text_spanner::brew_molecule (SCM smob)
       if (gh_pair_p (s))
        {
          Direction d = LEFT;
-         int dir = me->get_elt_property ("direction");
+         int dir = to_dir (me->get_elt_property ("direction"));
          do
            {
              Real dy = gh_scm2double (index_cell (s, d)) * - dir;
index 4d68c240747982d982756037a5c306f6135b2f79..9da8e66885c44e1413bc9b93cf59c50e3f1aff06 100644 (file)
@@ -19,7 +19,7 @@
 void
 Tie_column::set_interface (Score_element*me)
 {
-  me->set_interface (ly_symbol2scm ("tie-column"));
+  me->set_interface (ly_symbol2scm ("tie-column-interface"));
   me->set_extent_callback (SCM_EOL, X_AXIS);
   me->set_extent_callback (SCM_EOL, Y_AXIS) ; 
 }
@@ -27,7 +27,7 @@ Tie_column::set_interface (Score_element*me)
 bool
 Tie_column::has_interface (Score_element*me)
 {
-  return  me->has_interface (ly_symbol2scm ("tie-column"));
+  return  me->has_interface (ly_symbol2scm ("tie-column-interface"));
 }
 
 void
index 2912f3b37a5db75760b03826297016fa7b017b70..503b24003d4177198ce7d4df61f4716056c39aba 100644 (file)
@@ -9,6 +9,7 @@
 
 
 #include "molecule.hh"
+#include "text-item.hh"
 #include "time-signature.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
@@ -69,13 +70,18 @@ Time_signature::special_time_signature (Score_element*me, String s, int n, int d
 Molecule
 Time_signature::time_signature (Score_element*me,int num, int den)
 {
-  String sty = "timesig";
-
   /*
     UGH: need to look at fontsize.
+    TODO: specify using scm markup.
    */
-  Molecule n (me->lookup_l ()->text (sty, to_str (num), me->paper_l ()));
-  Molecule d (me->lookup_l ()->text (sty, to_str (den), me->paper_l ()));
+  SCM properties = gh_append2 (me->immutable_property_alist_,
+                              me->mutable_property_alist_);
+  Molecule n = Text_item::text2molecule (me,
+                                        ly_str02scm (to_str (num).ch_C ()),
+                                        properties);
+  Molecule d = Text_item::text2molecule (me,
+                                        ly_str02scm (to_str (den).ch_C ()),
+                                        properties);
   n.align_to (X_AXIS, CENTER);
   d.align_to (X_AXIS, CENTER);
   Molecule m;
index 24416817d00941fb8a32113d78cbf357e636f99a..6b735ad953232e7c317320ae2bd279c9013c6855 100644 (file)
@@ -343,9 +343,51 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va
           */
          if (gh_pair_p (prev) || prev == SCM_EOL)
            {
+             bool ok = true;
+             
+             SCM errport = scm_current_error_port ();
+             
+             SCM meta = scm_assoc (ly_symbol2scm ("meta"), prev);
+             SCM props = scm_assoc (ly_symbol2scm ("properties"), gh_cdr (meta));
+             SCM propdesc = scm_assoc (eltprop, gh_cdr (props));
+             if (!gh_pair_p (propdesc))
+               {
+                 scm_puts (_("Couldn't find property description for #'").ch_C(),errport);
+                 scm_display (eltprop, errport);
+
+                 scm_puts (_(" in element description ").ch_C(),errport);
+                 scm_display (prop, errport);
+
+                 scm_puts (_(". Perhaps you made a typing error?\n").ch_C(),errport);            
+               }
+             else
+               {
+                 
+                 SCM predicate = gh_cadr (propdesc);
+                 if (gh_call1 (predicate, val) == SCM_BOOL_F)
+                   {
+                     ok = false;
+                     scm_puts (_("Failed typecheck for #'").ch_C (),errport);
+                     scm_display (eltprop,errport);
+                     scm_puts ( _(", value ").ch_C (), errport);
+                     scm_display (val, errport);
+                     scm_puts (_(" must satisfy ").ch_C (), errport);
+                     scm_display (predicate, errport);
+                     scm_puts ("\n", errport);               
+                   }
+               }
+
+             if (ok)
+               {
                  prev = gh_cons (gh_cons (eltprop, val), prev);
                  set_property (prop, prev);
+               }
            }
+         else
+           {
+             // warning here.
+           }
+         
        }
       else
        {
index b35fb98b65af18a751447c15e392855b2e02c13a..14d905fa39772558f34d707f7fbbf867880a11e1 100644 (file)
@@ -14,6 +14,7 @@
 #include "molecule.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
+#include "text-item.hh"
 #include "tuplet-spanner.hh"
 #include "stem.hh"
 #include "note-column.hh"
@@ -75,9 +76,9 @@ Tuplet_spanner::brew_molecule (SCM smob)
       SCM number = me->get_elt_property ("text");
       if (gh_string_p (number) && number_visibility)
        {
-         Molecule
-           num (me->lookup_l ()->text ("italic",
-                                   ly_scm2string (number), me->paper_l ()));
+         SCM properties = gh_append2 (me->immutable_property_alist_,
+                                      me->mutable_property_alist_);
+         Molecule num = Text_item::text2molecule (me, number, properties);
          num.align_to (X_AXIS, CENTER);
          num.translate_axis (w/2, X_AXIS);
          num.align_to (Y_AXIS, CENTER);
index b2b42ac4f5dc479c27231d6d5be6c6d0f64d085b..dbd0cb7ffa3dfd8e561ea1315926f41a033747d2 100644 (file)
@@ -13,6 +13,7 @@
 #include "molecule.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
+#include "text-item.hh"
 #include "volta-spanner.hh"
 #include "group-interface.hh"
 #include "side-position-interface.hh"
@@ -88,10 +89,11 @@ Volta_spanner::brew_molecule (SCM smob)
                     SCM_UNDEFINED));
 
   Box b (Interval (0, w), Interval (0, h));
-  Molecule  mol (b, at);
-  Molecule num (me->lookup_l ()->text ("volta",
-                                      ly_scm2string (me->get_elt_property("text")),
-                                      me->paper_l ()));
+  Molecule mol (b, at);
+  SCM text = me->get_elt_property("text");
+  SCM properties = gh_append2 (me->immutable_property_alist_,
+                              me->mutable_property_alist_);
+  Molecule num = Text_item::text2molecule (me, text, properties);
 
   mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
                   - staff_space);
index bab60b66f467c892ada155269acfc36341507113..673620ddf8ed37424b7c5b4dacd95a7cb32e405d 100644 (file)
@@ -1,10 +1,3 @@
-%{
- chord modifiers
-%}
-
-% UGR 
-#(eval-string (ly-gulp-file "chord-names.scm"))
-
 
 % urg!
 %
index d0caa74ac3c6679de2c9bbfc3794539593e3fbff..ac43481fab0e886454f99cf55af40c08641dde5e 100644 (file)
@@ -53,7 +53,7 @@ melismaEnd = \property Staff.melismaBusy = ##f
 % ugh
 \include "midi.ly"
 
-\include "textscripts.ly"
+\include "dynamic-scripts.ly"
 \include "spanners.ly"
 
 \include "property.ly"
index 452bc2b2ca8eb28e160b1254df5ab53b8b34d4c3..b2781c3dd2db7275916f474b7fefcb83ecec7b29 100644 (file)
@@ -2,19 +2,10 @@ breve = \duration #'( -1 0)
 longa = \duration #'( -2 0 )
 maxima = \duration #'( -3 0 )
 
-
-#(begin
-  (eval-string (ly-gulp-file "slur.scm"))
-  (eval-string (ly-gulp-file "generic-property.scm"))
-  (eval-string (ly-gulp-file "basic-properties.scm"))
- )
-
 \include "nederlands.ly"               % dutch
 \include "chord-modifiers.ly"
 \include "script.ly"
 
-
-
 % declarations for standard directions
 left = -1
 right = 1
@@ -24,7 +15,6 @@ start = -1
 stop = 1
 smaller = -1
 bigger = 1
-
 center=0
 
 break =  \penalty  -1000000; 
@@ -33,10 +23,8 @@ nobreak =  \penalty 1000000;
 
 melisma = \property Staff.melismaBusy = ##t
 melismaEnd = \property Staff.melismaBusy = ##f
-
-
-
 papersize = "a4"
+
 \include "engraver.ly"
 \include "generic-paper.ly"
 \include "paper20.ly"
@@ -44,13 +32,12 @@ papersize = "a4"
 % ugh
 \include "midi.ly"
 
-\include "textscripts.ly"
+\include "dynamic-scripts.ly"
 \include "spanners.ly"
 
 \include "property.ly"
 
 
-
 unusedEntry = \notes { c4 }            % reset default duration
 
 % music = "\melodic\relative c"
diff --git a/ly/dynamic-scripts.ly b/ly/dynamic-scripts.ly
new file mode 100644 (file)
index 0000000..7ccd8d8
--- /dev/null
@@ -0,0 +1,24 @@
+
+%
+% declare the standard dynamic identifiers.
+%
+
+ppp = \dynamicscript #"ppp"
+pp = \dynamicscript #"pp"
+p = \dynamicscript #"p"
+mp = \dynamicscript #"mp"
+mf = \dynamicscript #"mf"
+f = \dynamicscript #"e"                        % see feta-din layout
+ff = \dynamicscript #"ff"
+fff = \dynamicscript #"fff"
+fp = \dynamicscript #"fp"
+
+sf = \dynamicscript #"sf"
+sfp = \dynamicscript #"sfp"
+sff = \dynamicscript #"sff"
+sfz = \dynamicscript #"sfz"
+fz = \dynamicscript #"fz"
+sp = \dynamicscript #"sp"
+spp = \dynamicscript #"spp"
+rfz = \dynamicscript #"rfz"
+
diff --git a/ly/generate-documentation.ly b/ly/generate-documentation.ly
new file mode 100644 (file)
index 0000000..03399af
--- /dev/null
@@ -0,0 +1,2 @@
+
+#(eval-string (ly-gulp-file "generate-documentation.scm"))
index 37fe4c19446bb0ffff9696c61616a26f24e89c50..ff3204e8e2dbda1a835e36fe1ce495b6c907252c 100644 (file)
@@ -26,8 +26,8 @@
 ;
 (define (default-beam-flag-width-function type)
   (cond
-   ((eq? type 1) 1.98)
-   ((eq? type 1) 1.65)
+   ((eq? type 1) 1.98) 
+   ((eq? type 1) 1.65) ;; FIXME: check what this should be and why
    (else 1.32)
    ))
 
 ; 
 (define basic-beam-properties
   `(
-    (interfaces . (beam-interface))
     (molecule-callback . ,Beam::brew_molecule)
     (thickness . 0.42) ; in staff-space, should use stafflinethick?
     (before-line-breaking-callback . ,Beam::before_line_breaking)
     (flag-width-function . ,default-beam-flag-width-function)
     (space-function . ,default-beam-space-function)
     (damping . 1)
-    (name . "beam")
+    (meta . ,(element-description "Beam" general-element-interface beam-interface))
     )
   )
 
diff --git a/scm/generate-documentation.scm b/scm/generate-documentation.scm
new file mode 100644 (file)
index 0000000..9f33bdf
--- /dev/null
@@ -0,0 +1,147 @@
+
+;;;; 
+;
+; This file generates documentation for the backend of lilypond.
+;
+;;;;
+
+
+(define (uniqued-alist  alist acc)
+  (if (null? alist) acc
+      (if (assoc (caar alist) acc)
+         (uniqued-alist (cdr alist) acc)
+         (uniqued-alist (cdr alist) (cons (car alist) acc)
+  ))))
+
+;;; TODO
+
+(define (wordwrap string)
+  ""
+  )
+  
+(define (self-evaluating? x)
+  (or (number? x) (string? x) (procedure? x))
+  )
+
+(define (type-name  predicate)
+  (cond
+   ((eq? predicate dir?) "direction")
+   ((eq? predicate ly-element?) "graphic element")
+   ((eq? predicate pair?) "pair")
+   ((eq? predicate integer?) "integer")
+   ((eq? predicate list?) "list")
+   ((eq? predicate symbol?) "symbol")
+   ((eq? predicate string?) "string")
+   ((eq? predicate boolean?) "string")
+   ((eq? predicate number?) "number")
+   ((eq? predicate char?) "char")
+   ((eq? predicate input-port?) "input port")
+   ((eq? predicate output-port?) "output port")   
+   ((eq? predicate vector?) "vector")
+   ((eq? predicate procedure?) "procedure") 
+   (else "(unknown)")
+  ))
+
+(define (htmlfy x)
+  (let*
+      ((x1 (regexp-substitute/global #f ">" x 'pre "&gt;" 'post))
+       (x2 (regexp-substitute/global #f "<" x1 'pre "&lt;" 'post))
+       )
+    x2))
+
+(define (scm->string val)
+  (string-append
+   (if (self-evaluating? val) "" "'")
+   (htmlfy 
+    (call-with-output-string (lambda (port) (display val port))))
+  ))
+
+(define (document-property prop desc)
+  (let ((handle (assoc (car prop) desc)))
+    (string-append
+     "\n<li><code>" (symbol->string (car prop)) "</code> (" (type-name (cadr prop)) ") -- "
+     (caddr prop)
+     "<br>default value:  <code>"
+     (if (pair? handle)
+        (scm->string (cdr handle))
+        "not set"
+        )
+     "</code>\n"
+  )
+  ))
+
+(define (document-interface interface elt-description)
+  (let* ((name (car interface))
+        (desc (cadr interface))
+        (props (caddr interface))
+        (docs (map (lambda (x) (document-property x elt-description))
+                   props))
+        )
+
+    (string-append
+     "<hr>"
+     "<h2>Interface: " (symbol->string name) "</h2>\n"
+     desc
+     "<hr>\n<ul>"
+     (apply string-append docs)
+     "</ul>"
+     )
+    ))
+
+;
+; generate HTML, return filename.
+;
+(define (document-element description)
+  (let* ((metah (assoc 'meta description))
+        (meta (if (pair? metah)
+                  (cdr metah)
+                  '((properties . ()) (name . "huh?"))
+                  ))
+        
+        (name (cdr (assoc 'name meta)))
+        (ifaces (cdr (assoc 'interface-descriptions meta)))
+        (ifacedoc (map (lambda (x) (document-interface x description))
+                               ifaces))
+        (outname  (string-append name ".html"))
+        (out (open-output-file outname))
+        )
+    (display (string-append "Writing " outname " ... \n") (current-error-port))
+    (display
+     (string-append "<title>LilyPond Element " name " </title>"
+                   "<h1>" name "</h1>"
+                   (apply string-append ifacedoc))
+     out)
+    outname
+    )
+  )
+
+(define (document-elements elts)
+  (let* ((files (map (lambda (x) (document-element (cdr x)))
+                   elts))
+       (outname  (string-append "backend.html"))
+       (out (open-output-file outname))
+       (l (map (lambda (x) (string-append
+                            "<li><a href=" x ">" x "</a>\n"))
+               files))
+       )
+
+       (display
+        (string-append
+         "<title>LilyPond backend documentation</title>"
+         "<h1>LilyPond backend documentation</h1>"
+         "<ul>"
+         (apply string-append l)
+         "</ul>"
+       )
+        out
+        )
+   ))
+
+; (display (document-interface stem-interface '()))
+; (define b (cdr (assoc 'Beam all-element-descriptions)))
+;(display b)
+
+;(document-element  b)
+
+(document-elements all-element-descriptions)
+
index a18f3fec56a4dd468e6def47fad0f6ce2daa1d98..d7f25a10af59bae2351803fb2ea5b38eb5e0c549 100644 (file)
@@ -11,6 +11,9 @@
 ;
 
 
+; We should repartition the entire scm side of lily in a
+; more sane way, using namesspaces/modules?
+
 ;(debug-enable 'backtrace)
 
 ;;; library funtions
   (string-append (number->string (car c)) " "
                 (number->string (cdr c)) " "))
 
-
 (define (font i)
   (string-append
    "font"
    (make-string 1 (integer->char (+ (char->integer #\A) i)))
    ))
 
-
-
 (define (scm-scm action-name)
   1)
 
      (string-append "\\special{src:" (number->string line) ":"
         (number->string col) " " file "}"
         ;; arg, the clueless take over the mailing list...
-        "\\special{-****-These-warnings-are-harmless-***}"
-        "\\special{-****-PLEASE-read-http://appel.lilypond.org/wiki/index.php3?PostProcessing-****}"
+;       "\\special{-****-These-warnings-are-harmless-***}"
+;       "\\special{-****-PLEASE-read-http://appel.lilypond.org/wiki/index.php3?PostProcessing-****}"
        )
 
      ; line numbers only:
     (6 . 0)
     )
   )
+
+(begin
+  (eval-string (ly-gulp-file "interface.scm"))
+  (eval-string (ly-gulp-file "slur.scm"))
+  (eval-string (ly-gulp-file "font.scm"))  
+  (eval-string (ly-gulp-file "generic-property.scm"))
+  (eval-string (ly-gulp-file "basic-properties.scm"))
+  (eval-string (ly-gulp-file "chord-names.scm"))
+  (eval-string (ly-gulp-file "element-descriptions.scm"))  
+ )
index 41150ef8d617e83292973c6a6194cf5506463d4c..2c10991f077dd4bf21e3b273a1b91ebe24b7eb9d 100644 (file)
 
 (define default-basic-slur-properties
   `(
-   (interfaces . (slur-interface))
    (molecule-callback . ,Slur::brew_molecule)
    (thickness . 1.2)           
    (spacing-procedure . ,Slur::set_spacing_rods)               
    (extremity-rules . ,default-slur-extremity-rules)
    (extremity-offset-alist . ,default-slur-extremity-offset-alist)
    (de-uglify-parameters . ( 1.5  0.8  -2.0))
-   (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (beautiful . 0.5)))
+   (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5)))
+   (beautiful . 0.5)
    (y-free . 0.75)
-   (name . "Slur")
+   (attachment-offset . ((0 . 0) . (0 . 0)))
+   (slope-limit . 0.8)
+   (meta . ,(element-description "Slur" general-element-interface slur-interface))
    )
   )
index 44ca2adec6faf1fd21e993cec60d4e2bdc23b01d..563e0308dcb55dae5a4a54d3fb659cfeac1e3a0f 100644 (file)
@@ -501,14 +501,17 @@ class Staff:
                        gap = (0,1)
                        for m in self.measures[1:]:
                                if not m or not m.valid:
+                                       sys.stderr.write ("Skipping non-existant measure")
                                        continue
 
                                fr = None
                                try:
                                        fr = m.frames[x]
                                except IndexError:
-                                       pass
-                               
+                                       
+                                       sys.stderr.write ("Skipping nonexistent frame")
+                                       laystr = laystr + "% FOOBAR ! \n"
+                                       print laystr
                                if fr:
                                        first_frame = fr
                                        if gap <> (0,1):
@@ -1043,6 +1046,7 @@ for opt in options:
 
 identify()
 
+e = None
 for f in files:
        if f == '-':
                f = ''
index 587a514b06b5728fbeb8e3a19e2bcd52eeac5628..fa2ec8706e418d88472ae6f2588a3c1bda1728e3 100644 (file)
@@ -1,25 +1,8 @@
 #!@PYTHON@
 # vim: set noexpandtab:
 # TODO:
-# * Figure out clean set of options.
+# * Figure out clean set of options. Hmm, isn't it pretty ok now?
 # * add support for .lilyrc
-# * %\def\preMudelaExample should be ignored by mudela-book because
-#   it is commented out
-# * if you run mudela-book once with --no-pictures, and then again
-#   without the option, then the pngs will not be created. You have
-#   to delete the generated .ly files and  rerun mudela-book.
-# * kontroller hvordan det skannes etter preMudelaExample i preamble
-#   det ser ut til at \usepackage{graphics} legges til bare hvis
-#   preMudelaExample ikke finnes.
-# * add suppoert for @c comments. Check that preamble scanning works after this.
-
-# * in LaTeX, commenting out blocks like this
-# %\begin{mudela}
-# %c d e
-# %\end{mudela} works as expected.
-# * \usepackage{landscape} is gone. Convince me it is really neede to get it back.
-# * We are calculating more of the linewidths, for example 2 col from 1 col.
-
 
 
 # This is was the idea for handling of comments:
@@ -368,15 +351,11 @@ output_dict= {
                }
        }
 
-def output_verbatim (body):#ugh .format
+def output_verbatim (body):
        if __main__.format == 'texi':
                body = re.sub ('([@{}])', '@\\1', body)
        return get_output ('output-verbatim') % body
 
-def output_mbverbatim (body):#ugh .format
-       if __main__.format == 'texi':
-               body = re.sub ('([@{}])', '@\\1', body)
-       return get_output ('output-verbatim') % body
 
 re_dict = {
        'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
@@ -407,13 +386,11 @@ re_dict = {
                 'landscape': no_match,
                 'verbatim': r"""(?s)(?P<code>@example\s.*?@end example\s)""",
                 'verb': r"""(?P<code>@code{.*?})""",
-                'mudela-file': '(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
+                'mudela-file': '(?m)^(?!@c)(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
                 'mudela' : '(?m)^(?!@c)(?P<match>@mudela(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
-                #ugh add check for @c
                 'mudela-block': r"""(?m)^(?!@c)(?P<match>(?s)(?P<match>@mudela(\[(?P<options>.*?)\])?\s(?P<code>.*?)@end mudela\s))""",
                  'option-sep' : ', *',
                  'intertext': r',?\s*intertext=\".*?\"',
-                 #ugh fix
                  'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
                  'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
                  'numcols': no_match,
@@ -574,16 +551,24 @@ def scan_latex_preamble(chunks):
                                paperguru.set_geo_option(k, o[k])
                idx = idx + 1
 
+def scan_texi_preamble (chunks):
+       # this is not bulletproof..., it checks the first 10 chunks
+       idx = 0
+       while 1:
+               if chunks[idx][0] == 'input':
+                       if string.find(chunks[idx][1], "@afourpaper") != -1:
+                               paperguru.m_papersize = 'a4'
+                       elif string.find(chunks[idx][1], "@afourwide") != -1:
+                               paperguru.m_papersize = 'a4wide'
+                       elif string.find(chunks[idx][1], "@smallbook") != -1:
+                               paperguru.m_papersize = 'smallbook'
+               idx = idx + 1
+               if idx == 10 or idx == len(chunks):
+                       break
+
 def scan_preamble (chunks):
        if __main__.format == 'texi':
-               #ugh has to be fixed when @c comments are implemented
-               # also the searching here is far from bullet proof.
-               if string.find(chunks[0][1], "@afourpaper") != -1:
-                       paperguru.m_papersize = 'a4'
-               elif string.find(chunks[0][1], "@afourwide") != -1:
-                       paperguru.m_papersize = 'a4wide'
-               elif string.find(chunks[0][1], "@smallbook") != -1:
-                       paperguru.m_papersize = 'smallbook'
+               scan_texi_preamble(chunks)
        else:
                assert __main__.format == 'latex'
                scan_latex_preamble(chunks)
@@ -679,17 +664,6 @@ def make_mudela_block(m):
        else:
            options = []
        options = filter(lambda s: s != '', options)
-       if 'mbverbatim' in options:#ugh this is ugly and only for texi format
-               s  = m.group()
-               im = get_re('intertext').search(s)
-               if im:
-                       s = s[:im.start()] + s[im.end():]
-               im = re.search('mbverbatim', s)
-               if im:
-                       s = s[:im.start()] + s[im.end():]
-               if s[:9] == "@mudela[]":
-                       s = "@mudela" + s[9:]
-               return [('mudela', m.group('code'), options, s)]
        return [('mudela', m.group('code'), options)]
 
 def do_columns(m):
@@ -767,11 +741,7 @@ def schedule_mudela_block (chunk):
        TODO has format [basename, extension, extension, ... ]
        
        """
-       if len(chunk) == 3:
-               (type, body, opts) = chunk
-               complete_body = None
-       else:# mbverbatim
-               (type, body, opts, complete_body) = chunk
+       (type, body, opts) = chunk
        assert type == 'mudela'
        file_body = compose_full_body (body, opts)
        basename = `abs(hash (file_body))`
@@ -784,7 +754,6 @@ def schedule_mudela_block (chunk):
                        else:
                            taken_file_names[basename] = taken_file_names[basename] + 1
                            basename = basename + "-%i" % taken_file_names[basename]
-       # writes the file if necessary, returns true if it was written
        if not g_read_lys:
                update_file(file_body, os.path.join(g_outdir, basename) + '.ly')
        needed_filetypes = ['tex']
@@ -795,18 +764,24 @@ def schedule_mudela_block (chunk):
        if 'eps' in opts and not ('eps' in needed_filetypes):
                needed_filetypes.append('eps')
        outname = os.path.join(g_outdir, basename)
-       if not os.path.isfile(outname + '.tex') \
-               or os.stat(outname+'.ly')[stat.ST_MTIME] > \
-                       os.stat(outname+'.tex')[stat.ST_MTIME]:
-               todo = needed_filetypes
-       else:
-               todo = []
-               
+       def f(base, ext1, ext2):
+               a = os.path.isfile(base + ext2)
+               if (os.path.isfile(base + ext1) and
+                   os.path.isfile(base + ext2) and
+                               os.stat(base+ext1)[stat.ST_MTIME] >
+                               os.stat(base+ext2)[stat.ST_MTIME]) or \
+                               not os.path.isfile(base + ext2):
+                       return 1
+       todo = []
+       if 'tex' in needed_filetypes and f(outname, '.ly', '.tex'):
+               todo.append('tex')
+       if 'eps' in needed_filetypes and f(outname, '.tex', '.eps'):
+               todo.append('eps')
+       if 'png' in needed_filetypes and f(outname, '.eps', '.png'):
+               todo.append('png')
        newbody = ''
        if 'verbatim' in opts:
                newbody = output_verbatim (body)
-       elif 'mbverbatim' in opts:
-               newbody = output_mbverbatim (complete_body)
 
        for o in opts:
                m = re.search ('intertext="(.*?)"', o)