From 0e38ba464b1f1d88562d6c624ecb29e31d497494 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:57:05 +0000 Subject: [PATCH] lilypond-1.3.95 --- buildscripts/clean-fonts.sh | 22 +- input/les-nereides.ly | 402 ++++++++++++------ input/test/arpeggio.ly | 15 + lily/arpeggio-engraver.cc | 114 +++++ lily/arpeggio.cc | 50 +++ lily/include/musical-request.hh | 7 + .../include/output-property-music-iterator.hh | 25 ++ lily/my-lily-lexer.cc | 1 + lily/output-property-music-iterator.cc | 25 ++ lily/span-arpeggio-engraver.cc | 88 ++++ mf/feta-generic.mf | 4 +- mf/feta-schrift.mf | 65 ++- scm/lily.scm | 2 + 13 files changed, 679 insertions(+), 141 deletions(-) create mode 100644 input/test/arpeggio.ly create mode 100644 lily/arpeggio-engraver.cc create mode 100644 lily/arpeggio.cc create mode 100644 lily/include/output-property-music-iterator.hh create mode 100644 lily/output-property-music-iterator.cc create mode 100644 lily/span-arpeggio-engraver.cc diff --git a/buildscripts/clean-fonts.sh b/buildscripts/clean-fonts.sh index 597efa9032..09ad8f13c6 100644 --- a/buildscripts/clean-fonts.sh +++ b/buildscripts/clean-fonts.sh @@ -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 diff --git a/input/les-nereides.ly b/input/les-nereides.ly index 0fe8249134..29a797ac7f 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -1,204 +1,221 @@ +%{ +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 r2 + \property Voice.Stem \pop #'direction + \property Voice.Stem \push #'direction = #1 + r4 r2 %3 - r4 r8. + r4 r8. \translator Staff=bass - cis,16^2^"m.g."( + cis,16^2^"m.d."( %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" - )e r| - r\mf )e r| + \property Voice.Stem \pop #'direction + \property Voice.Stem \push #'direction = #1 + cis'4()bis + r8 + )e^" "^1^4^5 r| + r )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 - + % Broken? + \property Voice.NoteColumn \push #'horizontal-shift = #1 + s2 + s1*2 + s4 + \property Voice.Stem \pop #'direction + \property Voice.Stem \push #'direction = #-1 + - %% fake grace - \skip 32*16; - %% end fake grace +#ifdef FAKE_GRACE + s32*16 +#endif - - r8 cis4. d4 [ | - <)a-2 cis,-1>] cis4. d4 [ e,> | - <\!)a cis,>] + \property Voice.NoteColumn \push #'force-hshift = #-0.2 + + %r8 cis4. d4 [ | + r8 cis4. d4 + \property Voice.NoteColumn \pop #'force-hshift + [ | + \property Voice.NoteColumn \push #'force-hshift = #-0.2 + <)a-2 cis,-1>] cis4. d4 + \property Voice.NoteColumn \pop #'force-hshift + [ | + <)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( [ ] | + r8. e,16-2( [ ] | %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 + \property Voice.Stem \pop #'direction + \property Voice.Slur \pop #'y-free + \property Voice.Slur \push #'y-free = #0.1 + r8. cis,,16( %3 - + \property Voice.Stem \pop #'length + \property Voice.Stem \push #'length = #5 + \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 - + \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 + \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 - -% { s8. \sustainup\clef bass;} + +% { s8. \clef bass;} > - %\grace { s16 s s s s32 s s s s \clef bass; s } - %\clef bass; - %\grace { } <)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 { } <)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 - \property basicSlurProperties \pop #'direction - \property Voice.basicSlurProperties \push #'direction = #0 - [e,8-5(\sustainup| + \grace { } <)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 + \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 - \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, + \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 index 0000000000..9e7f930ace --- /dev/null +++ b/input/test/arpeggio.ly @@ -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 + + } + \context Staff=two \notes\relative c{ + \clef bass; + g + + } + > +} diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc new file mode 100644 index 0000000000..3c9504512e --- /dev/null +++ b/lily/arpeggio-engraver.cc @@ -0,0 +1,114 @@ +/* + arpeggio-engraver.cc -- implement Arpeggio_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen + */ + +#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 stems_; + Link_array 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 (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 index 0000000000..1e7253645c --- /dev/null +++ b/lily/arpeggio.cc @@ -0,0 +1,50 @@ +/* + arpegggio.cc -- implement Arpeggio + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen + */ + +#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 (); +} + + diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 0c2d6f928d..e928984f3b 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -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 index 0000000000..6728324d3e --- /dev/null +++ b/lily/include/output-property-music-iterator.hh @@ -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 + */ + +#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 */ + diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index e394708996..c85b0a398e 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -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 index 0000000000..f2376b6b8c --- /dev/null +++ b/lily/output-property-music-iterator.cc @@ -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 + */ + +#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 index 0000000000..90b0767e67 --- /dev/null +++ b/lily/span-arpeggio-engraver.cc @@ -0,0 +1,88 @@ +/* + span-arpeggio-engraver.cc -- implement Span_arpeggio_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen +*/ + +#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 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); + diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index 4b53e941bf..365f26c54c 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -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; diff --git a/mf/feta-schrift.mf b/mf/feta-schrift.mf index 481e378e50..f4fc744a27 100644 --- a/mf/feta-schrift.mf +++ b/mf/feta-schrift.mf @@ -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"); diff --git a/scm/lily.scm b/scm/lily.scm index d15c8bd11a..d9a951c9f7 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -181,6 +181,8 @@ ; 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)))) )) -- 2.39.5