]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.95
authorfred <fred>
Tue, 26 Mar 2002 23:57:05 +0000 (23:57 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:57:05 +0000 (23:57 +0000)
13 files changed:
buildscripts/clean-fonts.sh
input/les-nereides.ly
input/test/arpeggio.ly [new file with mode: 0644]
lily/arpeggio-engraver.cc [new file with mode: 0644]
lily/arpeggio.cc [new file with mode: 0644]
lily/include/musical-request.hh
lily/include/output-property-music-iterator.hh [new file with mode: 0644]
lily/my-lily-lexer.cc
lily/output-property-music-iterator.cc [new file with mode: 0644]
lily/span-arpeggio-engraver.cc [new file with mode: 0644]
mf/feta-generic.mf
mf/feta-schrift.mf
scm/lily.scm

index 597efa90327c4190b95ee21b06e134730ce00e3d..09ad8f13c658c1e5b0279639834e3e6364006b8b 100644 (file)
@@ -9,17 +9,27 @@ esac
 
 # should use kpsepath 
 
+TEXDIRS=.
 if [ -d /var/lib/texmf ]; then
-    TEXDIR=/var/lib/texmf
-elif [ -d /var/texfonts ]; then
-    TEXDIR=/var/texfonts
+    TEXDIRS="$TEXDIRS /var/lib/texmf"
+fi
+if [ -d /var/spool/texmf ]; then
+    TEXDIRS="$TEXDIRS /var/tmp/texmf"
+fi
+if [ -d /var/tmp/texfonts ]; then
+    TEXDIRS="$TEXDIRS /var/spool/texfonts"
+fi
+if [ -d /var/texfonts ]; then
+    TEXDIRS="$TEXDIRS /var/texfonts"
+fi
+if [ -z $TEXDIR ]; then
+    TEXDIRS=". /var"
 else
-    TEXDIR=/var/
+    TEXDIRS=". $TEXDIRS"
 fi
 
 # remove possibly stale .pk/.tfm files 
-echo> /tmp/cleaning-font-dummy
-FILES=`find .  $TEXDIR -name "feta*$WHAT*tfm" -or -name "feta*$WHAT*pk"`
+FILES=`find $TEXDIRS -name "feta*$WHAT*tfm" -or -name "feta*$WHAT*pk"`
 
 echo removing $FILES
 rm  -f $FILES /tmp/cleaning-font-dummy
index 0fe82491342d111e80ba84f1c189c6619fb53d68..29a797ac7fde51f61b1ae447555ed35d922f17af 100644 (file)
+%{
+cpp -P -traditional -o l.ly les-nereides.ly
+cpp -P -traditional -o l-fake.ly  -DFAKE_GRACE les-nereides.ly
+%}
+
 \header{
     composer =   "ARTHUR GRAY";
     title =      "LES N\\'ER\\'EIDES";
     subtitle =   "THE NEREIDS";
     enteredby =  "JCN";
-    piece =      "Allegretto scherzando";
+    %piece =      "Allegretto scherzando";
     copyright =  "public domain";
     description = "Natiest piece of competition at http://www.orphee.com/comparison/study.html, see http://www.orphee.com/comparison/gray.pdf";
     comment =     "LilyPond (1.3.93) can't really do this yet, I guess";
 }
 
+
+%% cpp: don't start on first column
+ #(define (grace-beam-space-function multiplicity)
+         (* (if (<= multiplicity 3) 0.816 0.844) 0.8))
+
 global = \notes{
     \partial 2;
     \key a \major;
     \skip 2;
     \skip 1*2;
 
-    %\skip 1;
-
-    % fake grace
+#ifndef FAKE_GRACE
+    \skip 1;
+#else % FAKE_GRACE
     \skip 2.; \partial 32*24;
     \skip 32*24;
-    %end fake grace
+#endif % FAKE_GRACE
 
     \bar "||";
 }
 
 treble = \context Voice=treble \notes\relative c''{
-    r2
+    % Broken?
+    \property Voice.NoteColumn \push #'horizontal-shift = #0
+    \outputproperty #(make-type-checker 'text-item-interface) 
+           #'extra-offset = #'(-6 . 2)
+    r2^"Allegretto scherzando"
     %2
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #1
-    r4 <cis eis a cis> r2
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #1
+    r4 <cis\arpeggio eis a cis> r2
     %3
-    r4 <cis fis a cis> r8.
+    r4 <cis\arpeggio fis a cis> r8.
     \translator Staff=bass
-    cis,16^2^"m.g."( <fis8 fis,\sustainup> <e! e,!>
+    cis,16^2^"m.d."( <fis8 fis,> <e! e,!>
     %4
     <)dis,4 a' dis>
     \translator Staff=treble
-    \property basicSlurProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #1
+    \property Voice.Slur \pop #'direction
+    \property Voice.Slur \push #'direction = #1
     %% 8va
-    cis''''4 (
+    \property PianoStaff.connectArpeggios = ##t
+    cis''''4^"m.g."\arpeggio (
 
-%{
+#ifndef FAKE_GRACE
 
-    \property basicStemProperties \pop #'direction
-    % ugh
-    \property Voice.basicStemProperties \push #'direction = #0
+    \property Voice.Stem \pop #'direction
 
     % grace is a mess
     % maybe we should fake this and put 5/4 in this bar?
 
     \grace {
         )cis8
-       \property basicStemProperties \pop #'direction
-       \property Grace.basicStemProperties \push #'direction = #0
+       \property Grace.Stem \pop #'direction
+       \property Grace.Stem \push #'direction = #0
+       \property Grace.Beam \push #'space-function = #grace-beam-space-function
        %urg, dim. during grace dumps core here
-        %%[a16-5( fis dis] [cis'32 a-1 fis-4 dis\>] [cis a )\!fis-2]
+        %%[a16-5( fis dis] [cis'32 a-1 fis-4 dis] [cis a )fis-2]
         [a16-5( fis dis] [cis32 a-1 fis-4 dis] [cis a )fis-2]
     }
 
-%}
+#else % FAKE_GRACE 
 
-    %% fake grace:
-    \property basicNoteHeadProperties \pop #'font-size
-    \property basicStemProperties \pop #'font-size
-    \property basicBeamProperties \pop #'font-size
-    \property basicTextScriptProperties \pop #'font-size
-    \property basicSlurProperties \pop #'font-size
-    \property basicLocalKeyProperties \pop #'font-size
-
-    \property Voice.basicNoteHeadProperties \push #'font-size = #-1
-    \property Voice.basicStemProperties \push #'font-size = #-1
-    \property Voice.basicBeamProperties \push #'font-size = #-1
-    \property Voice.basicTextScriptProperties \push #'font-size = #-1
-    \property Voice.basicSlurProperties \push #'font-size = #-1
-    \property Voice.basicLocalKeyProperties \push #'font-size = #-1
+    \property Voice.NoteHead \push #'font-size = #-1
+    \property Voice.Stem \push #'font-size = #-1
+    \property Voice.Beam \push #'font-size = #-1
+    \property Voice.TextScript \push #'font-size = #-1
+    \property Voice.Slur \push #'font-size = #-1
+    \property Voice.LocalKey \push #'font-size = #-1
+    \property Voice.Beam \push #'space-function = #grace-beam-space-function
 
     )cis16
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #0
-    %%[a16^5( fis dis] [cis'32 a-1 fis-4 dis\>] [cis a )fis-2] s s s
-    [a16^5( fis dis] [cis32 a^1 fis^4 dis\>] [cis a )fis-2] s % s s
-
-    \property basicNoteHeadProperties \pop #'font-size
-    \property basicStemProperties \pop #'font-size
-    \property basicBeamProperties \pop #'font-size
-    \property basicTextScriptProperties \pop #'font-size
-    \property basicSlurProperties \pop #'font-size
-    \property basicLocalKeyProperties \pop #'font-size
-
-    %ugh ugh
-    \property Voice.basicNoteHeadProperties \push #'font-size = #0
-    \property Voice.basicStemProperties \push #'font-size = #0
-    \property Voice.basicBeamProperties \push #'font-size = #0
-    \property Voice.basicTextScriptProperties \push #'font-size = #0
-    \property Voice.basicSlurProperties \push #'font-size = #0
-    \property Voice.basicLocalKeyProperties \push #'font-size = #0
-    %% end fake grace
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #0
+    %%[a16^5( fis dis] [cis'32 a-1 fis-4 dis] [cis a )fis-2] s s s
+    [a16^5( fis dis] [cis32 a^1 fis^4 dis] [cis a )fis-2] s % s s
 
+    \property Voice.NoteHead \pop #'font-size
+    \property Voice.Stem \pop #'font-size
+    \property Voice.Beam \pop #'font-size
+    \property Voice.TextScript \pop #'font-size
+    \property Voice.Slur \pop #'font-size
+    \property Voice.LocalKey \pop #'font-size
+    \property Voice.Beam \pop #'space-function
 
+#endif % FAKE_GRACE
     
 
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #1
-    \!cis'4()bis
-    r8\mf-"a tempo"
-    <a'8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e r|
-    r\mf <a8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e r|
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #1
+    cis'4()bis
+    r8
+    <a'8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e^" "^1^4^5 r|
+    r<a8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e r|
 }
 
 trebleTwo = \context Voice=trebleTwo \notes\relative c''{
-    \skip 2;
-    \skip 1*2;
-    \skip 4;
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #-1
-    <cis4 a fis dis>
+    % 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>
 
-    %% fake grace
-    \skip 32*16;
-    %% end fake grace
+#ifdef FAKE_GRACE
+    s32*16
+#endif
 
-    <e2-"rall." g, e d>
-    r8 cis4. d4 [<cis8( e,> <b-3 d,-1> |
-    <)a-2 cis,-1>] cis4. d4 [<cis8(\> e,> <b d,> |
-    <\!)a cis,>]
+    \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
+    \property Voice.NoteColumn \pop #'force-hshift
+    [<cis8( e,> <b-3 d,-1> |
+    \property Voice.NoteColumn \push #'force-hshift = #-0.2
+    <)a-2 cis,-1>] cis4. d4 
+    \property Voice.NoteColumn \pop #'force-hshift
+    [<cis8( e,> <b d,> |
+    <)a cis,>]
 }
 
 bass = \context Voice=bass \notes\relative c{
-    \property Voice.basicSlurProperties \push #'details =
-        #'((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (beautiful . 5.0))
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #-1
+    \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)
+    \property Voice.Stem \pop #'direction
+    \property Voice.Slur \push #'direction = #-1
     % huh, auto-beamer?
-    r8. e,16-2\f( [<a8 a,> <b b,>] <cis4\sustaindown cis,> |
+    r8. e,16-2( [<a8 a,> <b b,>] <cis4 cis,> |
     %2
     \translator Staff=treble
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #-1
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #-1
     \property Voice.slurEndAttachment = #'stem
-    <)a''4 eis cis> 
+    <)a''4\arpeggio eis cis> 
     %\stemboth
     \property Voice.slurEndAttachment = ##f
     \translator Staff=bass
-    \property basicStemProperties \pop #'direction
-    % ugh
-    \property Voice.basicStemProperties \push #'direction = #'0
-    r8. cis,,16(\sustainup <fis8 fis,> <gis gis,>
+    \property Voice.Stem \pop #'direction
+    \property Voice.Slur \pop #'y-free
+    \property Voice.Slur \push #'y-free = #0.1
+    r8. cis,,16( <fis8 fis,> <gis gis,>
     %3
-    <a4\sustaindown a,>
+    \property Voice.Stem \pop #'length
+    \property Voice.Stem \push #'length = #5
+    <a4 a,>
     \translator Staff=treble
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #-1
-    <)a' fis cis>
+    \property Voice.Stem \pop #'length
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #-1
+    <)a'\arpeggio fis cis>
     \translator Staff=bass
-    \property basicStemProperties \pop #'direction
-    % ugh
-    \property Voice.basicStemProperties \push #'direction = #'0
+    \property Voice.Stem \pop #'direction
     r2
     %4
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #-1
-    <b,,4\sustaindown b,>
+    \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.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #-1
+    <b,,4 b,>
     \clef treble;
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #0
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #0
     <
         %urg: staff-change: ! on dis
-        <cis'' a fis dis!>
-%      { s8. \sustainup\clef bass;}
+        <cis''\arpeggio a fis dis!>
+%      { s8. \clef bass;}
     >
-    %\grace { s16 s s s s32 s s s s \clef bass; s }
-    %\clef bass;
-    %\grace { <e,,,32\sustaindown( e,> } <)gis'2 e>
 
-    %% fake grace
-    s4 s8 s32 s \sustainup s \clef bass; s
-    %% end fake grace
+#ifndef FAKE_GRACE
+    %Hmm
+    %\grace { s16 s s s s32 s s s s \clef bass; s }
+    \clef bass;
+#else
+    s4 s8 s32 s  s \clef bass; s
+#endif
 
-    \grace { <e,,,32( e,> } <)gis'2\sustaindown e>
-    %5
-    \property basicSlurProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #1
-    \property Staff.stopStartSustain = #""
-    a,8\sustainup\sustaindown [e'-5(<)a-2 cis-3>]
-    \property Staff.stopStartSustain = #"-P"
-     r b,-5\sustainup\sustaindown <e4-3 gis-5 d'>
-    \property basicSlurProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #0
-    [e,8-5(\sustainup|
+    \grace { <e,,,32( e,> } <)gis'2 e>
+    %5%
+    \property Voice.Slur \pop #'direction
+    \property Voice.Slur \push #'direction = #1
+    a,8 [e'-5(<)a-2 cis-3>]
+    r b,-5 <e4-3 gis-5 d'>
+    \property Voice.Slur \pop #'direction
+    \property Voice.Slur \push #'direction = #0
+    [e,8-5(|
     %6
-    )a-2\sustaindown]
-    \property basicSlurProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #1
-    [e'(<)a cis>] r b,\sustainup\sustaindown <e4 gis d'>
-    \property basicSlurProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #0
-    [e,8(\sustainup|
+    )a-2]
+    \property Voice.Slur \pop #'direction
+    \property Voice.Slur \push #'direction = #1
+    [e'(<)a cis>] r b, <e4 gis d'>
+    \property Voice.Slur \pop #'direction
+    \property Voice.Slur \push #'direction = #0
+    [e,8(|
     %7
     )a]
 }
@@ -208,16 +225,83 @@ bassTwo = \context Voice=bassTwo \notes\relative c{
     \skip 1*2;
     \skip 2;
 
-    %% fake grace
+#ifdef FAKE_GRACE
     \skip 32*16;
+#endif
+
+    \property Voice.Stem \pop #'direction
+    \property Voice.Stem \push #'direction = #1
+    \property Voice.Slur \pop #'direction
+    \property Voice.Slur \push #'direction = #1
 
-    \property basicStemProperties \pop #'direction
-    \property Voice.basicStemProperties \push #'direction = #1
-    \property basicSlurProperties \pop #'direction
-    \property Voice.basicSlurProperties \push #'direction = #1
     cis'4()bis
 }
 
+middleDynamics = \context Dynamics=middle \notes{
+    s8 s16 s\f s4
+    s1*2
+    %4
+    s2
+
+#ifdef FAKE_GRACE
+    s32*12
+    \outputproperty #(make-type-checker 'dynamic-interface) 
+           #'extra-offset = #'(0 . 1.5)
+    s32\> s s \!s
+#endif
+    s32 
+    \outputproperty #(make-type-checker 'text-item-interface) 
+           #'extra-offset = #'(0 . 1.5)
+    s-"rall." s s
+    s8 s4
+
+    \outputproperty #(make-type-checker 'dynamic-interface) 
+           #'extra-offset = #'(0 . 3.5)
+    s1\mf-"a tempo"
+    s8
+    \outputproperty #(make-type-checker 'dynamic-interface) 
+           #'extra-offset = #'(-1 . 3.5)
+    s8\mf s4 s4 s8\> s32 s s \!s
+}
+
+lowerDynamics = \context Dynamics=lower \notes{
+    s2
+    %2
+    s2\sustaindown s8. s16\sustainup s4
+    %3
+    s2\sustaindown s8. s16\sustainup s4
+    %3
+
+#ifndef FAKE_GRACE
+    s4\sustaindown s16
+    s32 s s\sustainup s
+    s32\sustaindown s s s
+    s8
+#else
+    s2\sustaindown
+    s32*12
+    s32 s s\sustainup s
+    s32\sustaindown s s s
+#endif
+
+    \property Dynamics.stopSustain = #""
+    s4 s16. s32\sustainup
+
+    %5
+    s8\sustaindown s s
+    \property Dynamics.stopSustain = #"*"
+    \property Dynamics.stopStartSustain = #"-P"
+    s s\sustainup\sustaindown s s
+    s\sustainup
+
+    %6
+    \property Dynamics.stopStartSustain = #""
+    s8\sustaindown s s
+    \property Dynamics.stopStartSustain = #"-P"
+    s s\sustainup\sustaindown s s
+    s\sustainup
+}
+
 \score{
     \context PianoStaff <
         \context Staff=treble <
@@ -225,21 +309,75 @@ bassTwo = \context Voice=bassTwo \notes\relative c{
            \treble
            \trebleTwo
         >
+       \context Dynamics=middle <
+           \global
+           \middleDynamics
+       >
         \context Staff=bass <
            \clef bass;
            \global
            \bass
            \bassTwo
         >
+       \context Dynamics=lower <
+           \global
+           \lowerDynamics
+       >
     >
     \paper {
        \translator {
            \ScoreContext
-           basicTimeSignatureProperties \push #'style = #"C"
+           TimeSignature \push #'style = #"C"
+        }
+       \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."
+           stopSustain = #"*"
+           stopStartSustain = #"*Ped."
+           startUnaChorda = #"una chorda"
+           stopUnaChorda = #"tre chorde"
+           % should make separate lists for stopsustain and startsustain 
+           
+           \consists "Piano_pedal_engraver";
+           \consists "Script_engraver";
+           \consists "Dynamic_engraver";
+           \consists "Text_engraver";
+           %GURGURGU, text is initialised using TextScript
+           TextScript \push #'style = #"italic"
+           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 {
            \GraceContext
-           basicStemProperties \push #'flag-style = #""
+           Stem \push #'flag-style = #""
         }
     }
 }
diff --git a/input/test/arpeggio.ly b/input/test/arpeggio.ly
new file mode 100644 (file)
index 0000000..9e7f930
--- /dev/null
@@ -0,0 +1,15 @@
+\score{
+    \context PianoStaff < 
+        \context Staff=one \notes\relative c''{
+            fis,\arpeggio
+            %%\property PianoStaff.SpanArpeggio \push #'connect = ##t
+            \property PianoStaff.connectArpeggios = ##t
+            <fis,\arpeggio a c>
+         }
+        \context Staff=two \notes\relative c{
+            \clef bass;
+            g
+            <g\arpeggio b d>
+        }
+    >
+}
diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc
new file mode 100644 (file)
index 0000000..3c95045
--- /dev/null
@@ -0,0 +1,114 @@
+/*   
+  arpeggio-engraver.cc -- implement Arpeggio_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#include "engraver.hh"
+#include "group-interface.hh"
+#include "item.hh"
+#include "musical-request.hh"
+#include "arpeggio.hh"
+#include "stem.hh"
+#include "local-key-item.hh"
+#include "rhythmic-head.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
+
+class Arpeggio_engraver : public Engraver
+{
+public:
+  VIRTUAL_COPY_CONS (Translator);
+  Arpeggio_engraver ();
+
+protected:
+  virtual void acknowledge_element (Score_element_info);
+  virtual void process_acknowledged ();
+  virtual void do_pre_move_processing ();
+  virtual bool do_try_music (Music *);
+
+private:
+  Item* arpeggio_; 
+  Arpeggio_req *arpeggio_req_;
+  Link_array <Score_element> stems_;
+  Link_array<Score_element> supports_;
+};
+
+Arpeggio_engraver::Arpeggio_engraver ()
+{
+  arpeggio_ = 0;
+  arpeggio_req_ = 0;
+}
+
+bool
+Arpeggio_engraver::do_try_music (Music* m)
+{
+  if (!arpeggio_req_)
+    {
+      if (Arpeggio_req *a = dynamic_cast<Arpeggio_req*> (m))
+       {
+         arpeggio_req_ = a;
+         return true;
+       }
+    }
+  return false;
+}
+
+void
+Arpeggio_engraver::acknowledge_element (Score_element_info info)
+{
+  if (arpeggio_req_)
+    {
+      if (Stem::has_interface (info.elem_l_))
+       {
+         stems_.push (info.elem_l_);
+       }
+      else if (Rhythmic_head::has_interface (info.elem_l_)
+              || Local_key_item::has_interface (info.elem_l_))
+       {
+         supports_.push (info.elem_l_);
+       }
+    }
+}
+
+void
+Arpeggio_engraver::process_acknowledged ()
+{
+  if (!arpeggio_ && !stems_.empty ())
+    {
+      arpeggio_ = new Item (get_property ("Arpeggio"));
+      arpeggio_->set_parent (stems_[0], Y_AXIS);
+      Side_position::set_axis (arpeggio_, X_AXIS);
+      Side_position::set_direction (arpeggio_, LEFT);
+      Pointer_group_interface pgi (arpeggio_, "stems");
+      for (int i = 0; i < stems_.size (); i++)
+       {
+         pgi.add_element (stems_[i]);
+         Side_position::add_support (arpeggio_, stems_[i]);
+       }
+      for (int i = 0; i < supports_.size (); i++)
+       {
+         Side_position::add_support (arpeggio_, supports_[i]);
+       }
+      announce_element (arpeggio_, arpeggio_req_);
+    }
+}
+
+void
+Arpeggio_engraver::do_pre_move_processing ()
+{
+  if (arpeggio_)
+    {
+      typeset_element (arpeggio_);
+      arpeggio_ = 0;
+    }
+  arpeggio_req_ = 0;
+  stems_.clear ();
+  supports_.clear ();
+}
+
+
+ADD_THIS_TRANSLATOR (Arpeggio_engraver);
+
diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc
new file mode 100644 (file)
index 0000000..1e72536
--- /dev/null
@@ -0,0 +1,50 @@
+/*   
+  arpegggio.cc -- implement Arpeggio
+
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#include "molecule.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "arpeggio.hh"
+#include "score-element.hh"
+#include "stem.hh"
+#include "staff-symbol-referencer.hh"
+
+bool
+Arpeggio::has_interface (Score_element* me)
+{
+  return me && me->has_interface (ly_symbol2scm ("arpeggio-interface"));
+}
+
+MAKE_SCHEME_CALLBACK (Arpeggio, brew_molecule, 1);
+SCM 
+Arpeggio::brew_molecule (SCM smob) 
+{
+  Score_element *me = unsmob_element (smob);
+  
+  Interval iv; 
+  for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element *stem = unsmob_element (gh_car (s));
+      iv.unite (Stem::head_positions (stem));
+    }
+
+  Molecule mol;
+  Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
+  Real staff_space = Staff_symbol_referencer::staff_space (me);
+  for (int i = (int)iv[MIN]/ 2; i < (int)(iv[MAX] - 1)/ 2; i++)
+    {
+      Molecule a (arpeggio);
+      a.translate_axis (i * staff_space, Y_AXIS);
+      mol.add_molecule (a);
+    }
+  mol.translate (Offset (-2 * staff_space, 0));
+
+  return mol.create_scheme (); 
+}
+
+
index 0c2d6f928dd3c925434307227503c64ca8a1a394..e928984f3b89fa96dd849543204b8e421e56c682 100644 (file)
@@ -176,4 +176,11 @@ class Melisma_playing_req : public Request
 public:
   VIRTUAL_COPY_CONS (Music);
 };
+
+class Arpeggio_req : public Request
+{
+public:
+  VIRTUAL_COPY_CONS (Music);
+};
+
 #endif // MUSICALREQUESTS_HH
diff --git a/lily/include/output-property-music-iterator.hh b/lily/include/output-property-music-iterator.hh
new file mode 100644 (file)
index 0000000..6728324
--- /dev/null
@@ -0,0 +1,25 @@
+/*   
+  output-property-music-iterator.hh -- declare Output_property_music_iterator
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#ifndef OUTPUT_PROPERTY_MUSIC_ITERATOR_HH
+#define OUTPUT_PROPERTY_MUSIC_ITERATOR_HH
+
+#include "simple-music-iterator.hh"
+
+class Output_property_music_iterator : public Simple_music_iterator
+{
+public:  
+  VIRTUAL_COPY_CONS (Music_iterator);
+  /* construction */
+protected:
+  virtual void process (Moment);
+};
+
+
+#endif /* OUTPUT_PROPERTY_MUSIC_ITERATOR_HH */
+
index e394708996916d363c30cd15ba411f7b039d6c3c..c85b0a398e3b66f2ca2ac41e56452279384e5ce9 100644 (file)
@@ -24,6 +24,7 @@
 
 static Keyword_ent the_key_tab[]={
   {"autochange", AUTOCHANGE},
+  {"arpeggio", ARPEGGIO },
   {"spanrequest", SPANREQUEST},
   {"commandspanrequest", COMMANDSPANREQUEST},  
   {"simultaneous", SIMULTANEOUS},
diff --git a/lily/output-property-music-iterator.cc b/lily/output-property-music-iterator.cc
new file mode 100644 (file)
index 0000000..f2376b6
--- /dev/null
@@ -0,0 +1,25 @@
+/*   
+  output-property-music-iterator.cc -- implement Output_property_music_iterator
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#include "input.hh"
+#include "music-list.hh"
+#include "output-property-music-iterator.hh"
+
+void
+Output_property_music_iterator::process (Moment m)
+{
+  if (last_processed_mom_ < Moment (0))
+    {
+      bool accepted = try_music (music_l_);
+      if (!accepted)
+       music_l_->origin ()->warning (_f ("Junking request: `%s'",
+                                         classname (music_l_)));
+    }
+
+  skip (m);
+}
diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc
new file mode 100644 (file)
index 0000000..90b0767
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+  span-arpeggio-engraver.cc -- implement Span_arpeggio_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "engraver.hh"
+#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"
+
+
+/** 
+
+  Make arpeggios that span multiple staffs.  Catch arpeggios, and span a
+  Span_arpeggio over them if we find more than two arpeggios.
+  */
+class Span_arpeggio_engraver : public Engraver
+{
+public:
+  VIRTUAL_COPY_CONS (Translator);
+  Span_arpeggio_engraver ();
+
+protected:
+  virtual void acknowledge_element (Score_element_info);
+  virtual void process_acknowledged ();
+  virtual void do_pre_move_processing ();
+
+private:
+  Item *span_arpeggio_;
+  Link_array<Score_element> arpeggios_;
+};
+
+
+Span_arpeggio_engraver::Span_arpeggio_engraver ()
+{
+  span_arpeggio_ = 0;
+}
+
+void
+Span_arpeggio_engraver::acknowledge_element (Score_element_info info)
+{
+    if (info.origin_trans_l_arr (this).size ()
+        && Arpeggio::has_interface (info.elem_l_))
+    {
+      arpeggios_.push (info.elem_l_);
+    }
+}
+
+void
+Span_arpeggio_engraver::process_acknowledged ()
+{
+  if (!span_arpeggio_ && arpeggios_.size () > 1
+      && to_boolean (get_property ("connectArpeggios")))
+    {
+      span_arpeggio_ = new Item (get_property ("SpanArpeggio"));
+      span_arpeggio_->set_parent (arpeggios_[0], Y_AXIS);
+      Side_position::set_axis (span_arpeggio_, X_AXIS);
+      Pointer_group_interface pgi (span_arpeggio_, "arpeggios");
+      for (int i = 0; i < arpeggios_.size () ; i++)
+       {
+         pgi.add_element (arpeggios_[i]);
+         span_arpeggio_->add_dependency (arpeggios_[i]);
+       }
+      
+      announce_element (span_arpeggio_, 0);
+    }
+}
+
+void
+Span_arpeggio_engraver::do_pre_move_processing ()
+{
+  if (span_arpeggio_) 
+    {
+      typeset_element (span_arpeggio_);
+      span_arpeggio_ = 0;
+    }
+  arpeggios_.clear ();
+}
+
+ADD_THIS_TRANSLATOR (Span_arpeggio_engraver);
+
index 4b53e941bf08ce5b93063ae02e62322061c925cd..365f26c54cecbca0e6d55e3756e464dbfd5a0516 100644 (file)
@@ -39,9 +39,9 @@ else:
 %      input feta-bolletjes;   
 %      input feta-banier;
 %      input feta-eindelijk;
-       input feta-klef;
+%      input feta-klef;
 %      input feta-toevallig;
-%      input feta-schrift;
+       input feta-schrift;
 %      input feta-haak;
 %      input feta-timesig;
 %      input feta-pendaal;
index 481e378e501d2b81d860d94a778ce696b2eb807e..f4fc744a2792bd7579a8212ae00d70b89cfc325e 100644 (file)
@@ -11,7 +11,6 @@
 
 fet_begingroup("scripts")
 
-
 def draw_fermata =
   save alpha, radius, crook_thinness, crook_fatness, dot_diam;
   
@@ -698,6 +697,70 @@ fet_beginchar("Coda", "coda", "coda")
 
 fet_endchar;
 
+thick#:=1/24designsize;
+define_blacker_pixels(thick);
+
+rthin:=1/8*staff_space;
+rthick:=2thick+rthin;
+
+def draw_arpeggio =
+       save alpha;
+       alpha:=-40;
+       save ne,nw,se,sw; pair ne,nw,se,sw;
+       save x,y;
+       
+       se=dir alpha; nw=dir (alpha+180);
+       ne=dir (alpha+90); sw=dir (alpha-90);
+       penpos1(rthin,alpha+90);
+       penpos2(5/4rthick,alpha);
+       penpos4(5/4rthick,alpha);
+       penpos5(rthin,alpha+90);
+       penpos3(3/4rthick,alpha);
+
+       z1=(width/2, height) - overshoot*se;
+       z2=2[z4,(width/2,height/2)];
+       z3=1/2[z2,z4];
+       x4=2/8staff_space;
+       y4=rthin;
+
+       z5=2[z1,(width/2,height/2)];
+       z6=z2l+1/2rthin*sw;
+       z7=z4l+1/2rthin*sw+1/2rthin*se;
+       z8=2[z6,(width/2,height/2)];
+       z9=2[z7,(width/2,height/2)];
+       
+       fill z1l{se}..{se}z6..z3l..z7{se}..{se}z5l..z5r{nw}..{nw}z8..z3r..z9{nw}..{nw}z1r.. cycle;
+       penlabels(1,2,3,4,5,6,7,8,9);
+       enddef;
+
+fet_beginchar("Arpeggio","arpeggio","arpeggio");
+       %draw_staff (-2, 2, 0.0);       
+       save height, overshoot, width;
+       height# = staff_space#;
+       width# = 0.8height#;
+        overshoot# = 0.25 staff_space#;
+       define_pixels (height,overshoot,width);
+       set_char_box(0, width#, 0, height#);
+       draw_arpeggio;
+       fet_endchar;
+
+% Extendable Trill symbol.
+% Not yet used
+% Rename me to Trill, rename Trill to Tr?
+fet_beginchar("Trill-element","trill-element","trill-element");
+       save height, overshoot;
+       height# = staff_space#;
+       width# = 0.8height#;
+        overshoot# = 0.25 staff_space#;
+       define_pixels (height,overshoot,width);
+       set_char_box(0, height#, 0, width#);
+       draw_arpeggio;
+       currentpicture := currentpicture shifted -(width/2, height/2);
+       currentpicture := currentpicture rotated 90;
+       currentpicture := currentpicture shifted (height/2, width/2);
+       fet_endchar;
+
+% Hmm
 input feta-slag;
 
 fet_endgroup("scripts");
index d15c8bd11aabd0fb6fe60eca55886c002d6a0970..d9a951c9f7a2142d618613a163c1eea254e98633 100644 (file)
 ; Make a function that checks score element for being of a specific type. 
 (define (make-type-checker symbol)
   (lambda (elt)
+    ;;(display  symbol)
+    ;;(eq? #t (ly-get-elt-property elt symbol))
     (not (eq? #f (memq symbol (ly-get-elt-property elt 'interfaces))))
     ))