]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.4 release/1.3.4
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 8 Nov 1999 15:24:17 +0000 (16:24 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 8 Nov 1999 15:24:17 +0000 (16:24 +0100)
70 files changed:
CHANGES
Documentation/topdocs/index.tely
TODO
VERSION
flower/include/array.hh
flower/include/array.icc
input/test/banter-chords.ly [new file with mode: 0644]
input/test/chords.ly
input/test/staff-line-leading.ly
lily/bar-number-engraver.cc
lily/bar-script-engraver.cc
lily/base-span-bar-engraver.cc
lily/beam.cc
lily/breathing-sign-engraver.cc
lily/breathing-sign.cc
lily/chord-name-engraver.cc
lily/chord.cc
lily/clef-engraver.cc
lily/clef-item.cc
lily/directional-element.cc [new file with mode: 0644]
lily/directional-spanner.cc
lily/dot-column.cc
lily/dots.cc
lily/include/breathing-sign.hh
lily/include/chord-name-engraver.hh
lily/include/chord.hh
lily/include/clef-item.hh
lily/include/directional-element.hh [new file with mode: 0644]
lily/include/directional-spanner.hh
lily/include/dots.hh
lily/include/paper-def.hh
lily/include/rest.hh
lily/include/rhythmic-head.hh
lily/include/staff-bar.hh
lily/include/staff-side.hh
lily/include/staff-symbol-referencer.hh
lily/include/stem.hh
lily/key-engraver.cc
lily/lily-guile.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/paper-outputter.cc
lily/pitch-squash-engraver.cc
lily/property-inspect.cc
lily/rest.cc
lily/rhythmic-head.cc
lily/slur-engraver.cc
lily/spacing-spanner.cc
lily/staff-bar.cc
lily/staff-margin-engraver.cc
lily/staff-side.cc
lily/staff-symbol-referencer.cc
lily/stem-engraver.cc
lily/stem.cc
lily/tie-engraver.cc
ly/chord-modifiers.ly
ly/engraver.ly
ly/paper11.ly
ly/paper13.ly
ly/paper16.ly
ly/paper20.ly
ly/paper23.ly
ly/paper26.ly
ly/params.ly
ly/property.ly
make/out/lilypond.lsm
make/out/lilypond.spec
scm/chord-names.scm [new file with mode: 0644]
scm/generic-property.scm
scm/lily.scm

diff --git a/CHANGES b/CHANGES
index a236328eae7c18987eacdd1c9d1a666ee241d771..81585aa9153f42497815fc1fc2dbf37bff76fb99 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,25 @@
+pl 2.jcn3
+       - chords:
+         * Chord is item
+         * junked TeX hacking
+         * configurable with styled strings from scm
+         * fixes: dim, /no X, tonic != C
+
+pl 2.jcn2
+       - chords from  scm 
+
+
+pl 3.hwn2
+       - visibility-lambdas into default elt properties SCM.
+       - clef types in SCM
+       - verticalDirection properties now in SCM.
+
+pl 3.hwn1
+       - move position_i_ into Staff_symbol_referencer
+       - move dir_ into Directional_element baseclass
+
+****************
+
 pl 2.hwn1
        - bf: dynamic style.
        - prepare to move dir_ into SCM. 
index e0044f32844f1e3045b031616dea0908f229f23a..dc1e42e5ffcc2d5bc630d93ea9d1052168365f05 100644 (file)
@@ -62,8 +62,6 @@ project.  The webpages for the stable version reside at GNU.
 
 @item @uref{http://www.cs.uu.nl/~hanwen/lilypond/} Han-Wen's site
 has the development pages.
-@item @uref{http://sca.uwaterloo.ca/lilypond/} Eric's mirror
-@item @uref{http://home.austin.rr.com/jbr/jeff/lilypond/} Jeff's Windows NT Distribution site
 @end itemize
 
 @ignore
@@ -81,33 +79,29 @@ top_of_NEWS
 @unnumberedsec Download
 
 @itemize @bullet
-@item @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/}
-@item @uref{http://sca.uwaterloo.ca/lilypond/}
-    Eric Praetzel was kind enough to provide a mirror of both the website
-    and the ftp site.
-@item  @uref{ftp://ftp.lilypond.org/pub/LilyPond/}
-       A mirror of the FTP site.  Updated at 0:00 MET daily. 
-@item @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/} RedHat binary
-@item @uref{ftp://ftp.debian.org/pub/debian/dists/unstable/main/binary-i386/tex} Debian binary
-@item @uref{http://home.austin.rr.com/jbr/jeff/lilypond/} Windows NT binary
-@item @uref{http://linux.umbc.edu/software/lilypond/rpms/} i386 RPM.
-@item @uref{ftp://ftp.freshmeat.net/pub/rpms/lilypond/} i386 RPM.
-@end itemize
-
-@unnumberedsubsec Webmaster's Disclaimer
+@item
+    Download development releases at
+@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/}
 
-These pages were entirely created from the LilyPond package-sources.
-Sorry for poor look they have: we want to be hacking at LilyPond, and
-not at the webpages.  If you want to volunteer for making shazzy
-webpages, then please mail us!
+@item Canadian mirror   @uref{http://sca.uwaterloo.ca/lilypond/} and @uref{ftp://sca.uwaterloo.ca/pub/} 
 
-Note: These pages are created from a @strong{development snapshots} of
-LilyPond, and it might even be created even from an unreleased
-development version.  The version of this webpage is printed at the
-bottom.
+@item Another site in Europe  @uref{ftp://ftp.lilypond.org/pub/LilyPond/}
+@item RedHat i386
+binary RPMs:  @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/}  
 
+@item Debian binary @uref{ftp://ftp.debian.org/pub/debian/dists/unstable/main/binary-i386/tex} 
+@item Windows NT:  @uref{http://home.austin.rr.com/jbr/jeff/lilypond/} 
+@item i386 RPM: @uref{http://linux.umbc.edu/software/lilypond/rpms/} 
+@item i386 RPM: @uref{ftp://ftp.freshmeat.net/pub/rpms/lilypond/} 
+@item Windows NT: @uref{http://home.austin.rr.com/jbr/jeff/lilypond/}
+@end itemize
 
+@unnumberedsubsec Webmaster's Disclaimer
 
+These pages were entirely created from a @strong{development snapshots}
+of the LilyPond package.  The version of this webpage is printed at the
+bottom. If you want to volunteer for making more beautiful webpages,
+then please mail us!
 
 
 @bye
diff --git a/TODO b/TODO
index 07f05fc75b2091ffbc2a5d3b6431192d28b0787d..f21b67e5dc5892d0e36964cafac61a12580be861 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-i-*-outline-layout:(2 (-1 -1 0 :) 0);outline-stylish-prefixes:nil -*-
+-*-outline-layout:(2 (-1 -1 0 :) 0);outline-stylish-prefixes:nil -*-
 
 * GNU LilyPond TODO
 Features you cannot find in the documentation as working, should be
@@ -10,7 +10,10 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 
 .* TODO
 . * make this file understandable for 3rd parties.
-. * use Rhythmic_head::position_i () for all Staff_referenced 
+. * break align order from SCM list. 
+. * time description should be put into SCM
+. *  context in embedded SCM errors.
+
 . * eradicate all VIRTUAL_COPY_CONS () macros ; use indexed creation,
     eg.
 
@@ -18,8 +21,12 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
        ctor_dict["Score_element"]->create_func ();
 
 . * acc at tied note after linebreak.
+. * fix font-naming and selecting
+. * fix naming: \interline Context.staffLineLeading, staff_line_leading (),
+staff_position staff_space
+. * chord tonic: placement of accidental  C#, Cb (from scm and C++)
 . * note head on stem err msg in dutch.
-. *  why need to run -C mf twice?
+. * why need to run -C mf twice?
 . * setting indent to 0 with \shape fails
 . * here's no difference at all in output. When either is jacked up to 7.0,
 everything works and matches up; when either is set just a bit above the
@@ -32,7 +39,6 @@ John
 . * hara kiri _8 clef.
 . * junk -M ?
 . * mudela-book doco
-. * rerun profile
 . * fix or replace feta-accordion.mf
 . * script engraver
 . * bracket pdf hack
@@ -54,7 +60,7 @@ _only_ affect staves.
 - for one of my test scores containing a modern edition of an early
 17'th century composition I have a leading measure containing the
 orginal clefs and note values of the original composition. I use the
-"harmonic" and "diamond" note head styles for that measure and would
+a"harmonic" and "diamond" note head styles for that measure and would
 like to have the stems of these notes _centered_ on the notehead as in
 the mensural music notation.
 
@@ -62,14 +68,10 @@ the mensural music notation.
 bar line fully drawn across the staves and after that keep to the
 ChoirStaff bar line types in the rest of the scores
 
-- autoBeamMelisma: if I explicitly beam notes in a staff with auto
-beaming disabled I would like to have these beams also to be
-melismatic.
-
 . * make all Feta (including dynamics) available to the user in
     textual scripts. Examples: "D.S. al \coda", "\mf espress.".
  
-. * Write scritp that uses --find-old-relative to do auto relativization.
+. * Write script that uses --find-old-relative to do auto relativization.
 . * Junk shared cruft (duration, moment) in lib/
 
 
@@ -81,8 +83,6 @@ melismatic.
 . * Key_engraver, Local_key_item
 . * Think of comprehensive solution for "if (grace_b == self_grace_b_)"
 . * String[String.length] doesn't trap.
-. * Beam
-. * Stem
 . * Rhythmic_column and interaction stem/rhythmic_column/note_head/dots.
 . * Duration
 . * clef engraver 
@@ -91,9 +91,20 @@ melismatic.
 . * junk Music_iterator::first_b_
 . * Bezier
 
-.* BUGS
-. * [c8. c16 c16 c16] in 6/8 timesig. 
+.* Beams
+. * [c8. c16 c16 c16] in 6/8 timesig.
+. * Rewrite Stem, Beam (hairy)
+.  * general shaving on Beam and Stem
+.  * use plet grouping
+.  * beams over bars
+. * Rests and beams don't work too well together. Example:
+   [ r8 g''16 des'] [r8 c16 a] 
+. * autoBeamMelisma: if I explicitly beam notes in a staff with auto
+beaming disabled I would like to have these beams also to be
+melismatic.
+. * The stemLength property should affect also beamed stems.
 . * staffside spanner (crescendo!) along with staffswitch.
+. * * auto melismaBusy for beams.
 
 . * 
 > \context Staff <
@@ -105,16 +116,10 @@ melismatic.
 
 .* STUFF
 . * We need feta-din*.mf files for more sizes than 10.
-- Rests and beams don't work too well together. Example:
-   [ r8 g''16 des'] [r8 c16 a] 
-
-- The stemLength property should affect also beamed stems.
-
 . * align left edge of broken tuplet-spanner (have a test case?)
 . * fix dynamics decently, ie. use kerning & ligatures.
 . * key restorations & repeats
 . * paperXX.ly \quartwidth, font setting not up to date. (Should read from AFM?)
-. * * auto melismaBusy for beams.
 . *In Caro Mio Ben, bar 8, there's a syllable that starts on a note, and
 ends on a pair of grace notes.  Standard practice is to mark this with
 a slur starting on the main note and ending on the grace note, so a
@@ -138,7 +143,6 @@ one of the spacing bugs mentioned in the TODO.
 . * do --safe for PS output?
 . * msgfmt -o check?
 . * collision of lyrics with span_bars. See star-spangled.
-. * Auto_beam debugging output (waarom/wanneer heb jij die weggehaald?)
 . * It is impossible to typeset two textual scripts that are stacked
   on top of eachother and avoids note collisions and at the same
   time are typeset with different textStyle. I tried to move around
@@ -398,7 +402,6 @@ languages:
 .  * german
 .  * dutch
 .  * swedish
-        .. ?
 
 . * chords
 .  * guitar chords (fret diagrams)
@@ -414,8 +417,7 @@ languages:
 
 . * input converters
 .  * NIFF?
-.  * ABC? 
-.  * SMDL?
+.  * musedata
 
 . * add to MIDI output:
 .  * sharp / flat on trills (in MIDI ??)
@@ -455,7 +457,6 @@ hesitate to ask.
 .  * account for rhythmic position in measure
 .  * etc.
 
-
 . * Output class, handles : (smallish)
 .  * help text /(c) notice?
 .  * version line
@@ -469,24 +470,10 @@ hesitate to ask.
 .  * PS lines to .eps files
 .  * write custom prolog
 
-. * SGML input
-
-. * Documentation
-.  * internal documentation
-
 . * more spanners (smallish)
 .  * Glissando
 .  * trill
 
-. * Rewrite Stem, Beam (hairy)
-.  * general shaving on Beam and Stem
-.  * use plet grouping
-.  * beams over bars
-
-. * lines:
-.  * Ledger lines, should be separate item: Ledger_lines
-.  * beam stem showthrough, inter beam sizes (french vs german style)
-
 . * Collisions
 .  * left/right note balls should be handled by Collision:
        < \multi 2; { \stem 1; <b c> } { <f as b> } >
@@ -515,15 +502,6 @@ hesitate to ask.
 .  * input property
 . * Figure out semicolons.
 . * <c f a>4 ?
-. * Viola mode?
-
-               @c c g e g 
-       for
-               c g es g, 
-
-               @A c g e g
-       for
-               cis gis e gis
 . * configure pitch_byte
 . * rest name configurable
 
@@ -536,8 +514,6 @@ hesitate to ask.
 
 . * write Dynamic_line (to group dynamics horizontally)
 
-. * use Real for all y positions.
-
 . * half-sharps, half-flats
 
 . * adaptive accidental spacing.
diff --git a/VERSION b/VERSION
index 5b55b3beb13c1725b0bd2537e97c3d2bbe27eef7..3262ab2017c9adca0f567e2102c81f0956aace83 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=3
+PATCH_LEVEL=4
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
index d6349588aa03324d0c81e3a14573f9abf012e570..f8f6e352fdc7a0a92c7b609bfb7b2c1ea2f70c62 100644 (file)
@@ -13,7 +13,7 @@
 #endif
 
 /// copy a bare (C-)array from #src# to #dest# sized  #count#
-template<class T> void arrcpy (T*dest, T*src, int count);
+template<class T> void arrcpy (T*dest, T const*src, int count);
 
 /**
   Scaleable array/stack template, for a type T with default constructor.
@@ -241,7 +241,7 @@ public:
       set_size (size_ + src.size_);
       arrcpy (array_p_+s,src.array_p_, src.size_);     
     }
-  Array<T> slice (int lower, int upper) ;
+  Array<T> slice (int lower, int upper) const; 
   void reverse();
 };
 
index 8b876ce85d2bca4e43ef1841ecec755f28f4d68e..71de84a8acb485f9111560a96f9bac5426c92cb0 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 template<class T> INLINE void 
-arrcpy (T*dest, T*src, int count)
+arrcpy (T*dest, T const* src, int count)
 {
   for (int i_shadows_local=0; i_shadows_local < count ; i_shadows_local++)
 #ifdef __powerpc__
@@ -98,7 +98,7 @@ Array<T>::remove_array_p ()
 
 template<class T> INLINE
 Array<T>
-Array<T>::slice (int lower, int upper)
+Array<T>::slice (int lower, int upper) const
 {
   assert (lower >= 0 && lower <=upper&& upper <= size_);
   Array<T> r;
diff --git a/input/test/banter-chords.ly b/input/test/banter-chords.ly
new file mode 100644 (file)
index 0000000..307b865
--- /dev/null
@@ -0,0 +1,66 @@
+\version "1.3.2";
+
+\header{
+enteredby =     "jcn";
+copyright =     "public domain";
+TestedFeatures =        "Banter named chords";
+}
+
+% test German (Banter) naming
+% for more conventional naming, comment scm stuff out
+
+% {
+#(set! pitch-names-alist
+      (append 
+      '(
+       ; use these for German naming
+       ((6 . 0) . ("H" ""))
+       ((6 . -1) . ("B" ("feta-1" . "\12")))
+       )
+      pitch-names-alist))
+
+#(set! chord-names-alist
+      (append 
+      '(
+        (((0 . 0) (2 . -1) (4 . -1)) . ("m" . ("script" . "5-")))
+       ; Co iso Cm5-7-
+       ; urg, niet te pruimen
+        ; (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("feta-1" . ".")))
+        (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("script" . "o")))
+       )))
+% }
+
+chord = \notes\transpose c''\chords{
+       % dim modifier means: lower all implicit additions
+       c:dim9
+       c:dim
+       c:dim7
+       % explicit additions are taken as entered:
+       c:m5-.7-
+       % note that 7 is a special case: it's always lowered by 1...
+       c:dim7-.9
+       c:dim9-.11
+
+       % test German names
+       b:dim7
+       bes:m5-
+
+       \break
+
+       c:sus2  %?
+       c:sus4
+       c^3
+       c^3.5
+       c:2.6^5
+       c:dim^5-
+       c:dim7^5-
+       cis:m5-
+}
+
+\score{
+       <
+               \context ChordNames \chord
+               \context Staff \chord
+       >
+}
+
index c74d5024304f974f5f42f14fb7c90d8d143e89e6..cf6251d30d3e0479e2b0b48ab6c4e96b95ed32d9 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.2.0";
+\version "1.3.2";
 
 %{
 Would this be acceptable/good enough/convenient for entry?
@@ -9,7 +9,7 @@ Would this be acceptable/good enough/convenient for entry?
    Cb                     ces
    Cm; Cmin               c:3-; c:m; c:min
    Caug                   c:5+; c:aug;
-   Cdim                   c:3-:5-; c:dim
+   Cdim                   c:3-.5-; c:dim
    Cmaj7                  c:7+; c:maj
    C7                     c:7
    Csus; Csus4            c:4; c:sus
index 03a5daf1d5f63b08a908f95958b0c33698e3aa2a..dbf97cf0712777a195c8a535feeac8cb13e3d36d 100644 (file)
@@ -2,7 +2,9 @@
   \notes \relative c'' \context GrandStaff <
        \context Staff = up { c4 c4  }
        \context Staff = down { \property Staff. staffLineLeading = #5.5 c4
-         <c8 d f g>
+         [<c8 d f g>
+          e]
+         [f c']
         }
 >
 }
index 2db31f2b918ab1cc9fcc044a936fc088efc14647..e7df04ae89dfa6dbdbbcd7b15897d7f1facb15f1 100644 (file)
@@ -18,7 +18,7 @@ Bar_number_engraver::Bar_number_engraver()
   axis_ = Y_AXIS;
   type_ = "barNumber";
   visibility_lambda_
-    = ly_ch_C_eval_scm ("postbreak_only_visibility");
+    = ly_ch_C_eval_scm ("postbreak-only-visibility");
 }
 
 void
index 21de711e9ac5f435e263e466a0c4227ceaf44d17..c8becdc046d6dc40415561bd89a91525a5f8bb9b 100644 (file)
@@ -25,7 +25,7 @@ Bar_script_engraver::Bar_script_engraver ()
   text_p_ =0;
   hang_on_clef_b_ = false;
   visibility_lambda_ 
-    = ly_ch_C_eval_scm ("non_postbreak_visibility");
+    = ly_ch_C_eval_scm ("non-postbreak-visibility");
 }
 
 void
@@ -162,7 +162,7 @@ Bar_script_engraver::create_items (Request *rq)
     {
       staff_side_p_
        ->set_elt_property ("padding",
-                           gh_double2scm(paper_l ()->get_realvar (gh_symbol2scm("interline"))));
+                           gh_double2scm(paper_l ()->get_var ("interline")));
     }
   
   staff_side_p_->set_elt_property ("visibility-lambda",
index 53800c6681fa6eca7c049ad4708354dc26723530..24ba35b14bc0d7f24cdc806ea9e8b6d170893b9f 100644 (file)
@@ -52,7 +52,7 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i)
        {
          spanbar_p_ = get_span_bar_p();
          spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
-         String visnam =  String(name()) + "_visibility";
+         String visnam =  String(name()) + "-visibility";
          
          spanbar_p_->set_elt_property ("visibility-lambda",
                                        ly_ch_C_eval_scm (visnam.ch_C()));
index 0d7b93157f654be423184360cc1270220cad7835..64ab8ea41fdaa019027096c78d827251ac5a8478 100644 (file)
@@ -312,7 +312,7 @@ Beam::get_default_dir () const
 void
 Beam::set_direction (Direction d)
 {
-  set_direction ( d);
+  Directional_spanner::set_direction (d);
   for (int i=0; i <stems_.size (); i++)
     {
       Stem *s = stems_[i];
index 2259c170976208c08a510c5203d4bf97636eba11..df9c9a70bdeea98cb56d2ce43500f141de9e50c2 100644 (file)
@@ -45,10 +45,6 @@ Breathing_sign_engraver::do_process_requests()
   if(breathing_sign_req_l_) {
     breathing_sign_p_ = new Breathing_sign;
 
-    SCM prop = get_property ("verticalDirection", 0);
-    if(isdir_b(prop))
-      breathing_sign_p_->set_vertical_position(to_dir (prop));
-
     announce_element (Score_element_info (breathing_sign_p_, breathing_sign_req_l_));
   }
 }
index 2e6ebde757dc5b369d45b8c74cd5a866ff7c7371..3578e06210a094b203574576ba709f165f67a1b6 100644 (file)
@@ -23,18 +23,9 @@ Breathing_sign::Breathing_sign ()
 {
   set_direction (UP);
   set_elt_property ("breakable", SCM_BOOL_T);
-  set_elt_property ("visibility-lambda",
-                   ly_ch_C_eval_scm ("non_postbreak_visibility"));
 }
 
-void
-Breathing_sign::set_vertical_position (Direction updown)
-{
-  assert(updown >= -1 && updown <= +1);
 
-  if(updown != 0)
-    set_direction (updown);
-}
 
 Molecule*
 Breathing_sign::do_brew_molecule_p () const
index ef0744d627219e1092001232021a8c859d383043..21f0a99f1ad7f4fa239b76293bc60574e0ba0233 100644 (file)
@@ -20,6 +20,7 @@ ADD_THIS_TRANSLATOR (Chord_name_engraver);
 
 Chord_name_engraver::Chord_name_engraver ()
 {
+  chord_p_ = 0;
   tonic_req_ = 0;
   inversion_req_ = 0;
   bass_req_ = 0;
@@ -61,7 +62,7 @@ Chord_name_engraver::do_try_music (Music* m)
 void
 Chord_name_engraver::do_process_requests ()
 {
-  if (text_p_arr_.size ())
+  if (chord_p_)
     return;
   if (!pitch_arr_.size ())
     return;
@@ -71,36 +72,20 @@ Chord_name_engraver::do_process_requests ()
   if (gh_boolean_p (chord_inversion))
     find_inversion_b = gh_scm2bool (chord_inversion);
 
-  Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_, 
-    find_inversion_b);
+  chord_p_ = new Chord (to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_, find_inversion_b));
     
-  Text_item* item_p =  new Text_item;
-
-  /*
-   TODO:
-     - switch on property, add american (?) chordNameStyle:
-       Chord::american_str (...)
-
-  SCM chordNameStyle = get_property ("chordNameStyle", 0);
-  if (chordNameStyle == "Banter")
-    item_p->text_str_ = chord.banter_str (inversion);
-   */
-
-  item_p->text_str_ = chord.banter_str ();
-  
-  text_p_arr_.push (item_p);
-  announce_element (Score_element_info (item_p, 0));
+  announce_element (Score_element_info (chord_p_, 0));
 }
 
 void
 Chord_name_engraver::do_pre_move_processing ()
 {
-  for (int i=0; i < text_p_arr_.size (); i++)
+  if (chord_p_)
     {
-      typeset_element (text_p_arr_[i]);
+      typeset_element (chord_p_);
     }
-  text_p_arr_.clear ();
   pitch_arr_.clear ();
+  chord_p_ = 0;
   tonic_req_ = 0;
   inversion_req_ = 0;
   bass_req_ = 0;
index adef8d4991c5e2f35ab1edd645515c788a6b3212..8dbc57a6c72bc6608f22fe2dfd931f516214e808 100644 (file)
@@ -9,7 +9,16 @@
 #include "chord.hh"
 #include "musical-request.hh"
 #include "warn.hh"
+#include "debug.hh"
+#include "molecule.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
 
+SCM
+pitch2scm (Musical_pitch p)
+{
+  return gh_cons (gh_int2scm (p.notename_i_), gh_int2scm (p.accidental_i_));
+}
 
 /*
   construct from parser output
@@ -17,7 +26,7 @@
 Chord
 to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p, Musical_pitch* inversion_p, Musical_pitch* bass_p)
 {
-  // urg: catch dim modifier: 5th and 7th should be lowered
+  // urg: catch dim modifier: 3rd, 5th, 7th, .. should be lowered
   bool dim_b = false;
   for (int i=0; i < add_arr_p->size (); i++)
     {
@@ -28,12 +37,10 @@ to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pi
          dim_b = true;
        }
     }
-  Chord::rebuild_transpose (add_arr_p, tonic);
-  Chord::rebuild_transpose (sub_arr_p, tonic);
+  Chord::rebuild_transpose (add_arr_p, tonic, true);
+  Chord::rebuild_transpose (sub_arr_p, tonic, true);
 
-  Musical_pitch fifth = tonic;
-  fifth.transpose (Musical_pitch (2));
-  fifth.transpose (Musical_pitch (2, -1));
+  Musical_pitch fifth = Chord::base_arr (tonic).top ();
 
   /*
     remove double adds (urg: sus4)
@@ -68,19 +75,21 @@ to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pi
   if (highest_step < 5)
     missing_arr.push (fifth);
 
+  /*
+    if dim modifier is given: lower all missing
+   */
   if (dim_b)
     {
       for (int i=0; i < missing_arr.size (); i++)
         {
-          missing_arr[i].accidental_i_--;
+         missing_arr[i].accidental_i_--;
        }
     }
 
   /*
     if additions include some 3, don't add third
    */
-  Musical_pitch third = tonic;
-  third.transpose (Musical_pitch (2));
+  Musical_pitch third = Chord::base_arr (tonic)[1];
   if (Chord::find_notename_i (add_arr_p, third) != -1)
     {
       int i = Chord::find_pitch_i (&missing_arr, third);
@@ -200,6 +209,7 @@ Chord::Chord (Array<Musical_pitch> pitch_arr, Musical_pitch* inversion_p, Musica
 }
 
 Chord::Chord (Chord const& chord)
+  : Item (chord)
 {
   pitch_arr_ = chord.pitch_arr_;
   inversion_p_ = chord.inversion_p_ ? new Musical_pitch (*chord.inversion_p_) : 0;
@@ -210,19 +220,33 @@ Chord::~Chord ()
 {
   delete inversion_p_;
   delete bass_p_;
+  // AAARGH, why doesn't Score_elt do this?
+  unsmobify_self ();
+}
+
+Array<Musical_pitch>
+Chord::base_arr (Musical_pitch p)
+{
+  Array<Musical_pitch> base;
+  base.push (p);
+  p.transpose (Musical_pitch (2));
+  base.push (p);
+  p.transpose (Musical_pitch (2, -1));
+  base.push (p);
+  return base;
 }
 
 void
-Chord::rebuild_transpose (Array<Musical_pitch>* pitch_arr_p, Musical_pitch tonic)
+Chord::rebuild_transpose (Array<Musical_pitch>* pitch_arr_p, Musical_pitch tonic, bool fix7_b)
 {
   for (int i = 0; i < pitch_arr_p->size (); i++)
     {
       Musical_pitch p = tonic;
       Musical_pitch q = (*pitch_arr_p)[i];
-      // duh, c7 should mean <c bes>
-      if (q.notename_i_ == 6)
-        q.accidental_i_--;
       p.transpose (q);
+      // duh, c7 should mean <c bes>
+      if (fix7_b && (step_i (tonic, p) == 7))
+        p.accidental_i_--;
       (*pitch_arr_p)[i] = p;
     }
   pitch_arr_p->sort (Musical_pitch::compare);
@@ -347,24 +371,28 @@ Chord::to_pitch_arr () const
 }
 
 void
-Chord::find_additions_and_subtractions (Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const
+Chord::find_additions_and_subtractions (Array<Musical_pitch> pitch_arr, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const
 {
-  Musical_pitch tonic = pitch_arr_[0];
+  Musical_pitch tonic = pitch_arr[0];
   /*
     construct an array of thirds for a normal chord
    */
   Array<Musical_pitch> all_arr;
   all_arr.push (tonic);
-  all_arr.push (pitch_arr_.top ());
+  if (step_i (tonic, pitch_arr.top ()) >= 5)
+    all_arr.push (pitch_arr.top ());
+  else
+    all_arr.push (base_arr (tonic).top ());
   all_arr.concat (missing_thirds_pitch_arr (&all_arr));
   all_arr.sort (Musical_pitch::compare);
   
   int i = 0;
   int j = 0;
-  while ((i < all_arr.size ()) || (j < pitch_arr_.size ()))
+  Musical_pitch last_extra = tonic;
+  while ((i < all_arr.size ()) || (j < pitch_arr.size ()))
     {
       Musical_pitch a = all_arr [i <? all_arr.size () - 1];
-      Musical_pitch p = pitch_arr_ [j <? pitch_arr_.size () - 1];
+      Musical_pitch p = pitch_arr[j <? pitch_arr.size () - 1];
       /*
         this pitch is present: do nothing, check next
        */
@@ -372,6 +400,7 @@ Chord::find_additions_and_subtractions (Array<Musical_pitch>* add_arr_p, Array<M
        {
          i++;
          j++;
+         last_extra = tonic;
        }
       /*
         found an extra pitch: chord addition
@@ -379,115 +408,221 @@ Chord::find_additions_and_subtractions (Array<Musical_pitch>* add_arr_p, Array<M
       else if ((p < a) || (p.notename_i_ == a.notename_i_))
        {
          add_arr_p->push (p);
-         (j < pitch_arr_.size ()) ? j++ : i++;
+         last_extra = p;
+         (j < pitch_arr.size ()) ? j++ : i++;
        }
       /*
         a third is missing: chord subtraction
        */
       else
        {
-         sub_arr_p->push (a);
+         if (last_extra.notename_i_ != a.notename_i_)
+           sub_arr_p->push (a);
          (i < all_arr.size ()) ? i++ : j++;
+         last_extra = tonic;
        }
     }
       
+  /* add missing basic steps */
+  if (step_i (tonic, pitch_arr.top ()) < 3)
+    sub_arr_p->push (base_arr (tonic)[1]);
+  if (step_i (tonic, pitch_arr.top ()) < 5)
+    sub_arr_p->push (base_arr (tonic).top ());
+
   /*
-    add highest addition, because it names chord
-    (1, 3 and) 5 not an addition: part of normal chord
+    add highest addition, because it names chord, if greater than 5
+    or non-standard
+    (1, 3 and) 5 not additions: part of normal chord
    */
-  if (step_i (tonic, pitch_arr_.top () > 5))
-    add_arr_p->push (pitch_arr_.top ());
+  if ((step_i (tonic, pitch_arr.top ()) > 5)
+       || pitch_arr.top ().accidental_i_)
+    add_arr_p->push (pitch_arr.top ());
 }
 
+
 /*
-  TODO:
-   reduce guess work: dim chord
-   other naming conventions `American'?
-   don't use TeX constructs
-   user defined chords-names for specific chords:
-      tonic, additions, subtractions, inversion, bass -> "my-chord-name"
+  word is roman text or styled text:
+   "text"
+   ("style" . "text")
  */
-String
-Chord::banter_str () const
+Molecule
+Chord::ly_word2molecule (SCM scm) const
 {
-  Musical_pitch tonic = pitch_arr_[0];
+  String style;
+  if (gh_pair_p (scm))
+    {
+      style = ly_scm2string (gh_car (scm));
+      scm = gh_cdr (scm);
+    }
+  String text = ly_scm2string (scm);
+  return lookup_l ()->text (style, text, paper_l ());
+}
+
+/*
+ scm is word or list of words:
+   word
+   (word word)
+ */
+Molecule
+Chord::ly_text2molecule (SCM scm) const
+{
+  Molecule mol;
+  if (gh_list_p (scm))
+    {
+      while (gh_cdr (scm) != SCM_EOL)
+        {
+         mol.add_at_edge (X_AXIS, RIGHT, 
+            ly_word2molecule (gh_car (scm)), 0);
+         scm = gh_cdr (scm);
+       }
+      scm = gh_car (scm);
+    }  
+  mol.add_at_edge (X_AXIS, RIGHT, 
+    ly_word2molecule (scm), 0);
+  return mol;
+}
+
+Molecule
+Chord::pitch2molecule (Musical_pitch p) const
+{
+  SCM name = scm_eval (gh_list (gh_symbol2scm ("user-pitch-name"), ly_quote_scm (pitch2scm (p)), SCM_UNDEFINED));
 
-  //urg, should do translation in scheme.
-  char const *acc[] = {"\\textflat\\textflat ", "\\textflat ", "", "\\textsharp " , "\\textsharp\\textsharp "};
-  String tonic_str = tonic.str ();
-  tonic_str = tonic_str.left_str (1).upper_str ()
-    + acc[tonic.accidental_i_ + 2];
+  if (name != SCM_UNSPECIFIED)
+    {
+      return ly_text2molecule (name);
+    }
+
+  Molecule mol = lookup_l ()->text ("", p.str ().left_str (1).upper_str (), paper_l ());
+  if (p.accidental_i_)
+    // urg, how to select the feta-1 font?
+    mol.add_at_edge (X_AXIS, RIGHT, 
+                    lookup_l ()->accidental (p.accidental_i_, 0), 0);
+  return mol;
+}
+
+Musical_pitch
+diff_pitch (Musical_pitch tonic, Musical_pitch  p)
+{
+  Musical_pitch diff (p.notename_i_ - tonic.notename_i_, 
+    p.accidental_i_ - tonic.accidental_i_, 
+    p.octave_i_ - tonic.octave_i_);
+
+  while  (diff.notename_i_ >= 7)
+    {
+      diff.notename_i_ -= 7;
+      diff.octave_i_ ++;
+    }
+  while  (diff.notename_i_ < 0)
+    {
+      diff.notename_i_ += 7;
+      diff.octave_i_ --;
+    }
+
+  diff.accidental_i_ -= (tonic.semitone_pitch () + diff.semitone_pitch ())
+    - p.semitone_pitch ();
+
+  return diff;
+}
 
+bool
+Chord::user_chord_name (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const
+{
+  SCM chord = SCM_EOL;
+  Array<Musical_pitch> chord_type = pitch_arr;
+  rebuild_transpose (&chord_type, diff_pitch (pitch_arr[0], Musical_pitch (0)), false);
+
+  for (int i= chord_type.size (); i--; )
+    chord = gh_cons (pitch2scm (chord_type[i]), chord);
+
+  SCM name = scm_eval (gh_list (gh_symbol2scm ("user-chord-name"), ly_quote_scm (chord), SCM_UNDEFINED));
+  if (name != SCM_UNSPECIFIED)
+    {
+      name_p->modifier_mol = ly_text2molecule (gh_car (name));
+      name_p->addition_mol = ly_text2molecule (gh_cdr (name));
+      return true;
+    }
+  return false;
+}
+
+void
+Chord::banter (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const
+{
   Array<Musical_pitch> add_arr;
   Array<Musical_pitch> sub_arr;
-  find_additions_and_subtractions (&add_arr, &sub_arr);
+  find_additions_and_subtractions (pitch_arr, &add_arr, &sub_arr);
                           
-
   Array<Musical_pitch> scale;
   for (int i=0; i < 7; i++)
     scale.push (Musical_pitch (i));
 
-  // 7 always means 7-...
-  //  scale.push (Musical_pitch (6, -1)); // b
-
-  rebuild_transpose (&scale, tonic);
+  Musical_pitch tonic = pitch_arr[0];
+  rebuild_transpose (&scale, tonic, true);
   
-  bool has3m_b = false;
-  bool has4_b = false;
-  bool has5m_b = false;
-  String str;
-  String minor_str;
+  /*
+    Does chord include this step?  -1 if flat
+   */
+  int has[16];
+  for (int i=0; i<16; i++)
+    has[i] = 0;
+
+  String mod_str;
+  String add_str;
   String sep_str;
   for (int i = 0; i < add_arr.size (); i++)
     {
       Musical_pitch p = add_arr[i];
       int step = step_i (tonic, p);
-      if (step == 4)
-       has4_b = true;
       int accidental = p.accidental_i_ - scale[(step - 1) % 7].accidental_i_;
+      if ((step < 16) && (has[step] != -1))
+        has[step] = accidental == -1 ? -1 : 1;
       if ((step == 3) && (accidental == -1))
        {
-         minor_str = "m";
-         has3m_b = true;
+         mod_str = "m";
        }
       /*
-       have Cdim rather than Cm5-, even if it's a prefix
+        urg.
+       This routine gets a lot simpler, if we don't try to be catch
+       the 'dim' chords.  However, we'll have to list every exceptional
+       'dim' chord in scm: otherwise we'll get stuff like Cdim7-, iso
+       Cdim7, etc
        */
-      else if ((step == 5) && (accidental == -1) && has3m_b)
+#ifdef SMART_DIM
+      else if ((step == 5) && (accidental == -1) && (has[3] == -1))
        {
-         minor_str = "dim";
-         has5m_b = true;
+         mod_str = "dim";
        }
+#endif
       else if (accidental
-              || (!(step % 2) || ((i + 1 == add_arr.size ()) && (step > 5))))
+              || (!(step % 2) 
+              || ((i == add_arr.size () - 1) && (step > 5))))
         {
-         str += sep_str;
+         add_str += sep_str;
          sep_str = "/";
           if ((step == 7) && (accidental == 1))
            {
-              str += "maj7";
+              add_str += "maj7";
            }
          else
-            {
-             /* 
-               if has3m_b and has5m_b, assume dim
-               don't mention dim-addition, except for chord-namer
-              */
-              if (((step/2) && (accidental == -1))
-                 && has3m_b && has5m_b)
-               {
-                 if (i == add_arr.size () - 1)
-                    str += to_str (step);
-                 else
+#ifdef SMART_DIM
+           {
+             if ((step % 2) && (accidental == -1) 
+                && (has[3] == -1) && (has[5] == -1))
+               {               
+                 if (i != add_arr.size () - 1)
                    sep_str = "";
+                 else
+                   add_str += to_str (step);
                }
              else
+#endif
                {
-                  str += to_str (step);
-                  if (accidental)
-                    str += accidental < 0 ? "-" : "+";
+                 add_str += to_str (step);
+                 if (accidental)
+                   add_str += accidental < 0 ? "-" : "+";
                }
-            }
+#ifdef SMART_DIM
+           }
+#endif
        }
     }
 
@@ -496,49 +631,28 @@ Chord::banter_str () const
       Musical_pitch p = sub_arr[i];
       int step = step_i (tonic, p);
       /*
-       if chord has 3-, assume minor and don't display 'no3'
-       if additions include 4, assume sus4 and don't display 'no3'
-       if has3m_b and has5m_b, assume 'dim' chord
+       if additions include 2 or 4, assume sus2/4 and don't display 'no3'
       */
-      if (!((step == 3) && (has3m_b || has4_b))
-         && !((step/2) && (step !=3) && (step !=7 ) && (p.accidental_i_ == 0) && has3m_b && has5m_b)
-         && !((step == 7) && (p.accidental_i_ == -1) && has3m_b && has5m_b))
+      if (!((step == 3) && (has[2] || has[4])))
        {
-         str += sep_str + "no" + to_str (step);
+         add_str += sep_str + "no" + to_str (step);
          sep_str = "/";
        }
     }
 
-  /*
-   have Co rather than Cdim7
-   */
-  if (minor_str + str == "dim7")
-    {
-      minor_str = "";
-      str = "o";
-    }
-    
-
-  String inversion_str;
-  if (inversion_p_)
+  if (mod_str.length_i ())
+    name_p->modifier_mol.add_at_edge (X_AXIS, RIGHT, 
+      lookup_l ()->text ("roman", mod_str, paper_l ()), 0);
+  if (add_str.length_i ())
     {
-      inversion_str = inversion_p_->str ();
-      inversion_str = "/" + inversion_str.left_str (1).upper_str ()
-       + acc[inversion_p_->accidental_i_ + 2];
+      if (!name_p->addition_mol.empty_b ())
+        add_str = "/" + add_str;
+      name_p->addition_mol.add_at_edge (X_AXIS, RIGHT,
+       lookup_l ()->text ("script", add_str, paper_l ()), 0);
     }
-
-  String bass_str;
-  if (bass_p_)
-    {
-      bass_str = bass_p_->str ();
-      bass_str = "/" + bass_str.left_str (1).upper_str ()
-       + acc[bass_p_->accidental_i_ + 2];
-
-    }
-
-  return tonic_str + minor_str + "$^{" + str + "}$" + inversion_str + bass_str;
 }
 
+
 int
 Chord::find_tonic_i (Array<Musical_pitch> const* pitch_arr_p)
 {
@@ -648,3 +762,83 @@ Chord::rebuild_with_bass (Array<Musical_pitch>* pitch_arr_p, int bass_i)
       bass.octave_i_--;
   pitch_arr_p->insert (bass, 0);
 }
+
+Molecule*
+Chord::do_brew_molecule_p () const
+{
+  Musical_pitch tonic = pitch_arr_[0];
+  
+  Chord_name name;
+  name.tonic_mol = pitch2molecule (tonic);
+
+  /*
+    if user has explicitely listed chord name, use that
+    
+    TODO
+    urg
+    maybe we should check all sub-lists of pitches, not
+    just full list and base triad?
+   */
+  if (!user_chord_name (pitch_arr_, &name))
+    {
+      /*
+        else, check if user has listed base triad
+       use user base name and add banter for remaining part
+       */
+      if ((pitch_arr_.size () > 2)
+         && user_chord_name (pitch_arr_.slice (0, 3), &name))
+        {
+         Array<Musical_pitch> base = base_arr (tonic);
+         base.concat (pitch_arr_.slice (3, pitch_arr_.size ()));
+         banter (base, &name);
+       }
+      /*
+        else, use pure banter
+       */
+      else
+       {
+         banter (pitch_arr_, &name);
+       }
+    }
+
+  if (inversion_p_)
+    {
+      name.inversion_mol = lookup_l ()->text ("", "/", paper_l ());
+      // zucht  const&
+      Molecule mol = pitch2molecule (*inversion_p_);
+      name.inversion_mol.add_at_edge (X_AXIS, RIGHT, mol, 0);
+    }
+
+  if (bass_p_)
+    {
+      name.bass_mol = lookup_l ()->text ("", "/", paper_l ());
+      Molecule mol = pitch2molecule (*bass_p_);
+      name.bass_mol.add_at_edge (X_AXIS, RIGHT, mol, 0);
+    }
+
+  // urg, howto get a good superscript_y?
+  Real super_y = lookup_l ()->text ("", "x", paper_l ()).dim_.y ().length ()/2;
+  if (!name.addition_mol.empty_b ())
+    name.addition_mol.translate (Offset (0, super_y));
+
+  Molecule* mol_p = new Molecule;
+  mol_p->add_at_edge (X_AXIS, RIGHT, name.tonic_mol, 0);
+  // huh?
+  if (!name.modifier_mol.empty_b ())
+    mol_p->add_at_edge (X_AXIS, RIGHT, name.modifier_mol, 0);
+  if (!name.addition_mol.empty_b ())
+    mol_p->add_at_edge (X_AXIS, RIGHT, name.addition_mol, 0);
+  if (!name.inversion_mol.empty_b ())
+    mol_p->add_at_edge (X_AXIS, RIGHT, name.inversion_mol, 0);
+  if (!name.bass_mol.empty_b ())
+    mol_p->add_at_edge (X_AXIS, RIGHT, name.bass_mol, 0);
+  return mol_p;
+}
+
+void
+Chord::do_print () const
+{
+#ifndef NPRINT
+  //DEBUG_OUT <<  "chord = " ...
+#endif
+}
index 4c7eb954c6c5876a54a170f6cd2d7197a1e62a64..deaac87548b9890d5ec364125a1014850027fdb7 100644 (file)
@@ -8,6 +8,9 @@
   Mats Bengtsson <matsb@s3.kth.se>
 */
 
+/*
+  CLEAN ME UP.
+ */
 #include <ctype.h>
 #include "bar.hh"
 #include "clef-engraver.hh"
@@ -30,31 +33,6 @@ Clef_engraver::Clef_engraver()
   create_default_b_ = true;
 }
 
-/*
-  PUT THIS IN GUILE!
- */
-struct Clef_settings {
-  char const *name;
-  char const *cleftype;
-  int position;
-} clef_settings[] = {
-  {"treble", "treble", -2},
-  {"violin", "treble", -2},
-  {"G", "treble", -2},
-  {"G2", "treble", -2},  
-  {"french", "treble",-4 },
-  {"soprano", "alto",-4 },
-  {"mezzosoprano", "alto",-2 },
-  {"alto", "alto",0 },
-  {"tenor", "alto",2 },
-  {"baritone", "alto",4 },
-  {"varbaritone", "bass",0 },
-  {"bass" , "bass",2 },
-  {"F", "bass", 2},
-  {"subbass", "bass",4},
-  {0,0,0}
-};
-
 bool
 Clef_engraver::set_type (String s)
 {
@@ -71,17 +49,25 @@ Clef_engraver::set_type (String s)
   else
     octave_dir_ = CENTER;
 
-  bool found = 0;
-  for (Clef_settings *c = clef_settings; !found && c->name; c++)
+  bool found = false;
+  SCM c = get_property ("supportedClefTypes",0);
+  for (; gh_pair_p(c); c = gh_cdr (c))
     {
-      if (c->name == s)
-       {
-         clef_type_str_ = c->cleftype;
-         clef_position_i_ = c->position;
-         found = 1;
-       }
-      }
+      SCM entry = gh_car (c);
+      SCM name  = gh_car (entry);
 
+      if (ly_scm2string (name) != s)
+       continue;
+      
+      SCM glyph  = gh_cadr (entry);
+      SCM pos  = gh_caddr (entry);
+      
+      clef_type_str_ = ly_scm2string (glyph);
+      clef_position_i_ = gh_scm2int (pos);
+      found = true;
+      break;
+    }
+    
   if (!found)
     {
       switch(toupper (s[0]))
@@ -126,11 +112,11 @@ Clef_engraver::acknowledge_element (Score_element_info info)
   if (dynamic_cast<Bar*>(info.elem_l_)
       && clef_type_str_.length_i())
     {
-      bool def = !clef_p_;
+      bool default_clef = !clef_p_;
       create_clef();
-      if(def)
+      if(!default_clef)
        clef_p_->set_elt_property("visibility-lambda",
-                                 ly_ch_C_eval_scm ("postbreak_only_visibility"));
+                                 ly_ch_C_eval_scm ("all-visibility"));
     }
 
   /* ugh; should make Clef_referenced baseclass */
@@ -139,8 +125,7 @@ Clef_engraver::acknowledge_element (Score_element_info info)
     {
       if (Note_head * h = dynamic_cast<Note_head*>(it_l))
        {
-         //      h->position_i_ += c0_position_i_;
-         h->position_i_ += c0_position_i_;
+         h->set_position (int (h->position_f ()) + c0_position_i_);
        }
       else if (Local_key_item *i = dynamic_cast<Local_key_item*> (it_l))
        {
@@ -195,7 +180,7 @@ Clef_engraver::create_clef()
     }
   
   clef_p_->symbol_ = clef_type_str_;
-  clef_p_->y_position_i_ = clef_position_i_;
+  clef_p_->set_position(clef_position_i_);
   if (octave_dir_)
     {
       clef_p_->set_elt_property ("octave-dir", gh_int2scm (octave_dir_));
@@ -218,7 +203,7 @@ Clef_engraver::do_process_requests()
       else
        set_type ( "treble");
       create_clef ();
-      create_default_b_ =0;
+      create_default_b_ = false;
     }
 }
 
index 168a1e45e9b58d7ab1b378a2fc1273cb53f73b29..6503c3a1d5eb7a744eedc35d020f1ac151a80738 100644 (file)
@@ -19,7 +19,7 @@
 void
 Clef_item::do_pre_processing()
 {
-  translate_axis (y_position_i_ * staff_line_leading_f () / 2.0, Y_AXIS);
+  Staff_symbol_referencer::do_pre_processing();
   SCM style_sym =get_elt_property ("style");
   String style;
   if (style_sym != SCM_UNDEFINED)
@@ -42,7 +42,7 @@ Clef_item::Clef_item()
   set_elt_property ("breakable", SCM_BOOL_T);
 
   symbol_ = "treble";
-  y_position_i_ = -2;
+  set_position(-2);
 }
 
 void
diff --git a/lily/directional-element.cc b/lily/directional-element.cc
new file mode 100644 (file)
index 0000000..7d9e9a6
--- /dev/null
@@ -0,0 +1,32 @@
+/*   
+  directional-element.cc -- implement Directional_element
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "directional-element.hh"
+#include "property-inspect.hh"
+
+Directional_element::Directional_element ()
+{
+}
+
+Direction
+Directional_element::get_direction () const
+{
+  // return dir_;
+  SCM d= get_elt_property ("direction");
+  if (!isdir_b(d))
+    return CENTER;
+      
+  return to_dir (d);
+}
+
+void
+Directional_element::set_direction (Direction d) 
+{
+  set_elt_property ("direction", gh_int2scm (d));
+}
index be9676c4d1a31b015e45c6f6c416890dacde7c0b..1ef4574bd9536a0f3be262159150b4029b71dec7 100644 (file)
@@ -13,10 +13,6 @@ Directional_spanner::do_pre_processing()
     set_direction (get_default_dir());
 }
 
-Directional_spanner::Directional_spanner()
-{
-  set_direction (CENTER);
-}
 
 Offset
 Directional_spanner::center () const
index d510fba7f46850ae6151e2332455b0019c72b557..3d3f73f41045137a1988edd53d669a849791c8fc 100644 (file)
@@ -39,7 +39,7 @@ Dot_column::do_substitute_element_pointer (Score_element*o,Score_element*n)
 int
 Dot_column::compare (Dots * const &d1, Dots * const &d2)
 {
-  return d1->position_i_ - d2->position_i_;
+  return int (d1->position_f () - d2->position_f ());
 }
 
 void
@@ -83,10 +83,11 @@ Dot_column::do_post_processing ()
   for (int i=0; i < dot_l_arr_.size (); i++)
     {
       for (int j=0; j < taken_posns.size (); j++)
-       if (taken_posns[j] == dot_l_arr_[i]->position_i_)
+       if (taken_posns[j] == (int) dot_l_arr_[i]->position_f ())
          conflicts++;
-      taken_posns.push (dot_l_arr_[i]->position_i_);
-      s.unite (Slice (dot_l_arr_[i]->position_i_,dot_l_arr_[i]->position_i_));      
+      taken_posns.push ((int)dot_l_arr_[i]->position_f ());
+      s.unite (Slice ((int)dot_l_arr_[i]->position_f (),
+                     (int)dot_l_arr_[i]->position_f ()));      
     }
 
   if (!conflicts)
@@ -102,6 +103,6 @@ Dot_column::do_post_processing ()
 
   for (int i=0; i  <dot_l_arr_.size (); pos += 2, i++)
     {
-      dot_l_arr_[i]->position_i_ = pos;
+      dot_l_arr_[i]->set_position(pos);
     }
 }
index 43dac770573bb6f8e8a486f282189601ea5a2e7a..d4c8e62eed53735aafb40035246bdd1619824909 100644 (file)
@@ -14,7 +14,6 @@
 Dots::Dots ()
 {
   dots_i_ =0;
-  position_i_ =0;
   resolve_dir_ =CENTER;
 }
 
@@ -39,7 +38,7 @@ Dots::do_brew_molecule_p () const
 {
   Molecule *out = new Molecule;
   Molecule fill = lookup_l ()->fill (Box (Interval (0,0),
-                                              Interval (0,0)));
+                                         Interval (0,0)));
   out->add_molecule (fill);
 
   Molecule d = lookup_l ()->dots ();
index 6e861a905c06f46a8b71884df912d9ebfcb7ac09..0378d62078fd1ec46d2c3e87df2b700f4dd0a68c 100644 (file)
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
 #include "parray.hh"
+#include "directional-element.hh"
 
-class Breathing_sign : public Item, public Staff_symbol_referencer {
+class Breathing_sign : public Item,
+                      public Staff_symbol_referencer,
+                      public Directional_element
+{
 public:
   VIRTUAL_COPY_CONS(Score_element);
   Breathing_sign ();
 
   void set_vertical_position (Direction);
-  void set_direction (Direction d ) { dir_ =  d; }
-  Direction get_direction () const { return dir_; }
 
 
 protected:
   virtual void do_post_processing ();
   virtual Molecule* do_brew_molecule_p () const;
-
-private:
-  Direction dir_;
 };
 
+
+
 #endif // BREATHING_SIGN_HH
index 4843fae8e999b32668af8af6fe1660eddc4af931..f5e52ee7823e0a048f68fe1d4bf8ffb8ccd2679d 100644 (file)
@@ -28,8 +28,7 @@ protected:
 
 private:
   Array<Musical_pitch> pitch_arr_;
-  Link_array<Item> text_p_arr_;
-  Array<Musical_pitch> rebuild_pitch_arr (int tonic_i) const;
+  Chord* chord_p_;
   Tonic_req* tonic_req_;
   Inversion_req* inversion_req_;
   Bass_req* bass_req_;
index 871189fafc1c958deea2962691daf27cbb1c76a0..e568f709854c704ff1f949bbf33df4d83a84b334 100644 (file)
 #include "array.hh"
 #include "musical-pitch.hh"
 #include "lily-proto.hh"
+#include "item.hh"
+#include "molecule.hh"
 
-class Chord
+class Chord_name
 {
 public:
+  Molecule tonic_mol;
+  Molecule modifier_mol;
+  Molecule addition_mol;
+  Molecule inversion_mol;
+  Molecule bass_mol;
+};
+
+class Chord : public Item
+{
+public:
+  VIRTUAL_COPY_CONS (Score_element);
+  static Array<Musical_pitch> base_arr (Musical_pitch p);
   static int find_tonic_i (Array<Musical_pitch> const*);
   static int find_pitch_i (Array<Musical_pitch> const*, Musical_pitch p);
   static int find_notename_i (Array<Musical_pitch> const*, Musical_pitch p);
   static Array<Musical_pitch> missing_thirds_pitch_arr (Array<Musical_pitch> const* pitch_arr_p);
   static void rebuild_from_base (Array<Musical_pitch>*, int base_i);
   static void rebuild_insert_inversion (Array<Musical_pitch>*, int tonic_i);
-  static void rebuild_transpose (Array<Musical_pitch>*, Musical_pitch tonic);
+  static void rebuild_transpose (Array<Musical_pitch>*, Musical_pitch tonic, bool fix7_b);
   static void rebuild_with_bass (Array<Musical_pitch>*, int bass_i);
   static int step_i (Musical_pitch tonic, Musical_pitch p);
 
   Chord (Array<Musical_pitch> pitch_arr, Musical_pitch* inversion_p, Musical_pitch* bass_p);
-  Chord (Chord const& chord);
-  ~Chord ();
+  Chord (Chord const&);
+  virtual ~Chord ();
 
 
   Array<Musical_pitch> to_pitch_arr () const;
 
-  String banter_str () const;
-  void find_additions_and_subtractions(Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const;
+  void find_additions_and_subtractions(Array<Musical_pitch> pitch_arr, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const;
+
+  Molecule ly_word2molecule (SCM scm) const;
+  Molecule ly_text2molecule (SCM scm) const;
+  Molecule pitch2molecule (Musical_pitch p) const;
+  bool user_chord_name (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const;
+  void banter (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const;
 
   Array<Musical_pitch> pitch_arr_;
   Musical_pitch* inversion_p_;
   Musical_pitch* bass_p_;
+
+protected:
+  virtual Molecule* do_brew_molecule_p () const;
+  virtual void do_print () const;
 };
 
 Chord to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p, Musical_pitch* inversion_p, Musical_pitch* bass_p);
index c37277e312768ce32cd607c423f029dd54b9f47f..11362d72fa832aba713ab38d6bea0a5163b643d9 100644 (file)
@@ -31,7 +31,6 @@ protected:
 public:
   
   String symbol_;
-  int y_position_i_;
 
   VIRTUAL_COPY_CONS(Score_element);
   Clef_item();
diff --git a/lily/include/directional-element.hh b/lily/include/directional-element.hh
new file mode 100644 (file)
index 0000000..a94bfce
--- /dev/null
@@ -0,0 +1,25 @@
+/*   
+  directional-element.hh -- declare Directional_element
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef DIRECTIONAL_ELEMENT_HH
+#define DIRECTIONAL_ELEMENT_HH
+
+#include "score-element.hh"
+
+struct Directional_element : public virtual Score_element
+{
+  void set_direction (Direction d);
+  Direction get_direction () const;
+
+  VIRTUAL_COPY_CONS(Score_element);
+  Directional_element ();
+};
+
+#endif /* DIRECTIONAL_ELEMENT_HH */
+
index cdc56a4ed1ee63722e981568fde8d227ddd59ce5..93d226fdaa5b07716930629f2baacc23c846fec2 100644 (file)
@@ -8,20 +8,14 @@
 #define DIRECTIONALSPANNER_HH
 
 #include "spanner.hh"
+#include "directional-element.hh"
 
 /** a spanner which can be pointing "up" or "down".
 
     JUNKME?
  */
-class Directional_spanner : public Spanner{
-  /// -1 below heads, +1 above heads.
-  Direction dir_;
-
+class Directional_spanner : public Spanner, public Directional_element {
 public:
-  Directional_spanner();
-
-  void set_direction (Direction d ) { dir_ =  d; }
-  Direction get_direction () const { return dir_; }
   
   /// offset of "center" relative to left-column/0-pos of staff
   virtual Offset center() const;
index 29e1bd5b114d7a59a3adcb0926d5621573556aea..2806cb1cc4a749d4c918902b11b1e96929f63046 100644 (file)
@@ -23,7 +23,6 @@ protected:
   virtual void do_post_processing ();
 public:
   int dots_i_;
-  int position_i_;
   Direction resolve_dir_;
   
   Dots ();
index f9393470943728b4f81112537d994015b400d83f..310cfd29d09513eecf93c8ae2686e98ae2d6701e 100644 (file)
@@ -54,6 +54,9 @@ public:
   virtual ~Paper_def ();
 
   Array<Interval> shape_int_a_;
+  /*
+    JUNKME
+   */
   Real get_realvar (SCM symbol) const;
   Real get_var (String id) const;
 
index 611ddd7103466fd85ce660c6e53426ac43f1108a..39b6bb2b203c0cfc213a74eddb7b67128780ced1 100644 (file)
@@ -15,7 +15,6 @@
 class  Rest : public Rhythmic_head
 {
 public:
-  Rest ();
   void add_dots (Dots*);
 protected:
   virtual void do_add_processing ();
index 7f792787dba2555b682333ec1560970598d8e2f0..3d912e0cb0cd8791445eba9e19e4e0f88e111f25 100644 (file)
@@ -18,7 +18,6 @@ class Rhythmic_head : public Item, public Staff_symbol_referencer
 public:
   Stem * stem_l_;
   int balltype_i_;
-  int position_i_;
 
   Dots * dots_l_;
 
@@ -26,10 +25,9 @@ public:
   Rhythmic_head ();
 
   int dots_i ()const;
-  virtual Real position_f () const;
 protected:
   virtual void do_post_processing ();
-  virtual void do_pre_processing ();
+
   virtual void do_print () const;
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
 };
index 4f604ad080b6029beb17143687b480b66397b4a4..171ec1ddc062e21f15dfa71b12d2ce4708bbc2f6 100644 (file)
    A bar that is on a staff.
    Ugh. Entita non multiplicandum  ... 
  */
-class Staff_bar : public Bar , public Staff_symbol_referencer
+class Staff_bar : public Bar, public Staff_symbol_referencer
 {
 public:
+  virtual void do_pre_processing ();
   VIRTUAL_COPY_CONS(Score_element);
   virtual Real get_bar_size () const;
 };
index 36441beefa5e90793f861b1b3595b1d0d1ebb854..81510632aa429d7acfd1f0c910bade5f94576cba 100644 (file)
@@ -14,6 +14,7 @@
 #include "spanner.hh"
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
+#include "directional-element.hh"
 
 /**
    Position myself next to a set of elements.  Configurable in axis
 
     Amount of extra space to add.
 */
-class Staff_side_element :  public Staff_symbol_referencer
+class Staff_side_element :  public Staff_symbol_referencer,
+  public Directional_element
 {
   void position_self ();
-  Direction dir_;
+
 public:
   Score_element * to_position_l_;
   
-  void set_direction (Direction d ) { dir_ =  d; }
-  Direction get_direction () const { return dir_; }
-  
 
   Link_array<Score_element> support_l_arr_;
   Axis axis_;
index 255c57abcca1f1c9227a41013bc5046c6826c135..5fc62e0ed02a2832e8e51c86498aaa9ac6918457 100644 (file)
@@ -21,9 +21,11 @@ class Staff_symbol_referencer : public virtual Score_element
 {
 protected:
   Staff_symbol * staff_sym_l_;
-
+  int position_i_;
 public:
   Staff_symbol_referencer ();
+  void set_position (int);
+  
   void set_staff_symbol (Staff_symbol*);
   /**
      Leading are the lead strips between the sticks (lines) of
@@ -34,7 +36,7 @@ public:
   Staff_symbol * staff_symbol_l () const;
   int lines_i () const;
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
-
+  virtual void do_pre_processing ();
   virtual Real position_f () const;
 };
 
index 2d91e441e9c0a8d6d07abda450ff207a2396411f..411848696b843cac8d8ba4db0e8df5da1d59a553 100644 (file)
@@ -11,6 +11,7 @@
 #include "moment.hh"
 #include "molecule.hh"
 #include "staff-symbol-referencer.hh"
+#include "directional-element.hh"
 
 /**the rule attached to the ball.
   takes care of:
   */
 // todo: remove baseclass Staff_symbol_referencer, since stem
 // can be across a staff.
-class Stem : public Item, public Staff_symbol_referencer {
+class Stem : public Item, public Staff_symbol_referencer,
+            public Directional_element
+{
 
   /**extent of the stem (positions).
     fractional, since Beam has to adapt them.
     */
   Drul_array<Real> yextent_drul_;
 
-  /// direction stem (that's me)
-  Direction dir_;
-
 public:
-  void set_direction (Direction d);
-  Direction get_direction () const { return dir_; }
 
   Link_array<Note_head> head_l_arr_;
   Link_array<Rest> rest_l_arr_;
index e5c53f74f8fb487a2cb1204537eab13f99b528fa..c7b1675fa1bb1fc7fc2f18b700b1d170793dc13c 100644 (file)
@@ -89,10 +89,10 @@ Key_engraver::acknowledge_element (Score_element_info info)
     {
       bool def =  (!item_p_);
       create_key ();
-      if (def)
+      if (!def)
        {
          item_p_->set_elt_property ("visibility-lambda",
-                                   ly_ch_C_eval_scm ("postbreak_only_visibility"));
+                                   ly_ch_C_eval_scm ("all-visibility"));
        }
     }
 
index 7fd60380af192ffedecf821611b38f51fd60f113..2ecad9547a20e99047a504fd8c41d996f606d6b9 100644 (file)
@@ -217,11 +217,24 @@ ly_warning (SCM str)
   return SCM_BOOL_T;
 }
 
+SCM
+ly_isdir_p (SCM s)
+{
+  if (gh_number_p (s))
+    {
+      int i = gh_scm2int (s);
+      return (i>= -1 && i <= 1)  ? SCM_BOOL_T : SCM_BOOL_F; 
+    }
+  return SCM_BOOL_F;
+}
+
+
 void
 init_functions ()
 {
   scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning);
   scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file);
+  scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p);  
 }
 
 ADD_SCM_INIT_FUNC(funcs, init_functions);
index faad35629763a484d80bc55d3829cc64be66b728..a8ee5f3f9a66a35102bd17e11616f7bdba8c75fc 100644 (file)
@@ -33,7 +33,7 @@ Note_head::do_pre_processing ()
   if (balltype_i_ > 2)
     balltype_i_ = 2;
   if (dots_l_)                 // move into Rhythmic_head?
-    dots_l_->position_i_ = int (position_f ());
+    dots_l_->set_position(int (position_f ()));
 }
 
 
@@ -67,7 +67,7 @@ Note_head::do_brew_molecule_p() const
 
 
   String type; 
-  SCM style  =get_elt_property ("style");
+  SCM style  = get_elt_property ("style");
   if (style != SCM_UNDEFINED)
     {
       type = ly_scm2string (style);
index 74168092d48e8c50543d6a0c0ce94fd01ee5443f..3ce360fed0d0417a1baf9f56827c1e2c91f1b6c1 100644 (file)
@@ -79,7 +79,7 @@ Note_heads_engraver::do_process_requests()
          announce_element (Score_element_info (d,0));
          dot_p_arr_.push (d);
        }
-      note_p->position_i_  = note_req_l->pitch_.steps ();
+      note_p->set_position(note_req_l->pitch_.steps ());
 
       /*
        TODO: transparent note heads.
index 9dd7d28729a0e156418e04608e0e9c5ee1e0fe69..14316cad02ffe988354719563f33fca8b51db90d 100644 (file)
@@ -127,12 +127,12 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
 
       if (a_off.length () > 100 CM)
        {
-         warning (_f ("improbable offset for object type: `%s'", nm));
+         programming_error ("improbable offset for object");
          Axis a  =X_AXIS;
          while (a < NO_AXES)
            {
-             if (abs(a_off[a]) > 50 CM)
-               a_off[a] = 50 CM;
+             if (abs(a_off[a]) > 30 CM)
+               a_off[a] = 30 CM;
              incr (a);
            }
        }
@@ -230,6 +230,11 @@ Paper_outputter::output_version ()
 void
 Paper_outputter::start_line (Real height)
 {
+  if (height > 50 CM)
+    {
+      programming_error ("Improbable system height");
+      height = 50 CM;
+    }
   SCM scm = gh_list (ly_symbol ("start-line"),
                     gh_double2scm (height),
                     SCM_UNDEFINED);
index eb3e1bc16b872727a6c3a3ecda697b82c6e1e193..8218ff66c9d29f50edefb81cd93108185aa0a91d 100644 (file)
@@ -15,7 +15,7 @@ Pitch_squash_engraver::acknowledge_element (Score_element_info i)
 {
   if (Note_head *nh = dynamic_cast<Note_head *> (i.elem_l_))
     {
-      nh->position_i_  =0;
+      nh->set_position(0);
     }
 }
 
index 57093f8bce8adffac3f6485baee180df7ac6415d..af4e5a607d94a6c1ac6033e51c38d06163c28000 100644 (file)
@@ -14,7 +14,7 @@ isdir_b (SCM s)
 {
   if (gh_number_p (s))
     {
-      int i = gh_int2scm (s);
+      int i = gh_scm2int (s);
       return i>= -1 && i <= 1; 
     }
   return false;
index 7a3e5fab03c1b445e1fb4e339b7c549928b9f3a7..a7974c5ead393a78206aa057c0b456130525cfd5 100644 (file)
@@ -18,7 +18,7 @@ void
 Rest::do_add_processing ()
 {
   if (balltype_i_ == 0)
-    position_i_ += 2;
+    position_i_ += 2;          // guh.
 
   Rhythmic_head::do_add_processing ();
 }
@@ -27,18 +27,19 @@ void
 Rest::do_post_processing ()
 {
   Rhythmic_head::do_post_processing ();
-  if (dots_l_ && balltype_i_ > 4)
+  if (dots_l_
+      && balltype_i_ > 4) // UGH.
     {
-      dots_l_->position_i_ += 3;
+      /*
+       UGH. 
+       */
       if (balltype_i_ == 7)
-       dots_l_->position_i_++;
+       dots_l_->set_position (4);
+      else
+       dots_l_->set_position (3);
     }
 }
 
-Rest::Rest ()
-{
-  position_i_ =0;
-}
 
 Molecule *
 Rest::do_brew_molecule_p () const
@@ -47,7 +48,6 @@ Rest::do_brew_molecule_p () const
 
   if (balltype_i_ == 0 || balltype_i_ == 1)
     ledger_b = abs(position_f ()  - (2* balltype_i_ - 1)) > lines_i (); 
-      
 
   
   String style; 
index 2f1a10197d4be7a4586e8f3952ae5ebcf6968943..0698b0c3cf2578626f19e5926c92ad06fff8d5db 100644 (file)
@@ -30,23 +30,10 @@ Rhythmic_head::do_post_processing ()
 {
   if (dots_l_)
     {
-      dots_l_->position_i_ = int (position_f ());
+      dots_l_->set_position(int (position_f ()));
     }
 }
 
-void
-Rhythmic_head::do_pre_processing ()
-{
-  translate_axis (position_i_ * staff_line_leading_f () /2.0, Y_AXIS);
-  position_i_ = 0;
-}
-
-Real
-Rhythmic_head::position_f () const
-{
-  return position_i_ +  Staff_symbol_referencer::position_f ();
-}
-
 
 void
 Rhythmic_head::add_dots (Dots *dot_l)
@@ -60,7 +47,6 @@ Rhythmic_head::Rhythmic_head ()
   dots_l_ =0;
   balltype_i_ =0;
   stem_l_ =0;
-  position_i_ =0;
 }
 
 void
index 6795c9d01f76ec511fbd275b1b32ca35d59260a9..ae15cd1d65071241b4358b90ddfb020a684fd734 100644 (file)
@@ -104,18 +104,8 @@ Slur_engraver::do_process_requests()
 void
 Slur_engraver::do_pre_move_processing()
 {
-  SCM dir (get_property ("slurVerticalDirection", 0));
-  SCM dir2 (get_property ("verticalDirection", 0));
-
-  Direction slurdir = CENTER;
-  if (gh_number_p(dir))
-    slurdir = to_dir (dir);
-  else if (gh_number_p (dir2))
-    slurdir = to_dir (dir2);
-  
   for (int i = 0; i < end_slur_l_arr_.size(); i++)
     {
-      end_slur_l_arr_[i]->set_direction (slurdir);
       typeset_element (end_slur_l_arr_[i]);
     }
   end_slur_l_arr_.clear();
index cb7eb9b4d4d3ff1781010b5fd8fc4337a6fefa2e..ece98451f7f44b7042563aba873d156b6c540c95 100644 (file)
@@ -269,7 +269,7 @@ Spacing_spanner::stem_dir_correction (Score_column*l, Score_column*r) const
 
   bool err = false;
   Real correction = 0.0;
-  Real ssc = paper_l ()->get_realvar(ly_symbol ("stemSpacingCorrection"));
+  Real ssc = paper_l ()->get_var("stemSpacingCorrection");
 
 
   if (d1 && d2)
index 00e71d2282e89e59750d20b67ed5f9bca4a3947b..55167bbd3266f5edafe562d547ca8083f7818da7 100644 (file)
@@ -19,3 +19,9 @@ Staff_bar::get_bar_size () const
     return (lines_i () -1) * staff_line_leading_f ();
 }
 
+void
+Staff_bar::do_pre_processing ()
+{
+  Bar::do_pre_processing ();
+  Staff_symbol_referencer::do_pre_processing ();
+}
index a382bf84b15d42af088323bd88b2b3d1f4ae8ff1..13c9c7f9e6e8bdd83d9db6cbb8ad024d0bd00bbb 100644 (file)
@@ -18,7 +18,7 @@ Staff_margin_engraver::Staff_margin_engraver ()
 {
   axis_ = X_AXIS;
   type_ = "margin";
-  visibility_lambda_ = ly_ch_C_eval_scm ("postbreak_only_visibility");
+  visibility_lambda_ = ly_ch_C_eval_scm ("postbreak-only-visibility");
 }
 
 
index 5f923b89d8186819fe04fe13cc44728b31dbef57..5e737330a0640a094f034e412f3bb0c6ca902278 100644 (file)
@@ -16,7 +16,6 @@
 
 Staff_side_element::Staff_side_element ()
 {
-  set_direction (CENTER);
   to_position_l_ = 0;
   set_elt_property ("transparent", SCM_BOOL_T);
   axis_ = Y_AXIS;
index 2af11bc5f7b98aec50b358c04baa5e182f79abdf..2c6a3a17bc5c1451621e4b683d8f1e227f681f27 100644 (file)
@@ -16,6 +16,7 @@
 Staff_symbol_referencer::Staff_symbol_referencer ()
 {
   staff_sym_l_ =0;
+  position_i_ =0;
 }
 
 void
@@ -55,12 +56,33 @@ Staff_symbol_referencer::staff_line_leading_f () const
 Real
 Staff_symbol_referencer::position_f () const
 {
-  if (!staff_sym_l_ )
-    return 0;
+  Real p = position_i_;
+  if (staff_sym_l_ )
+    {
+      Graphical_element * c = common_refpoint (staff_sym_l_, Y_AXIS);
+      Real y = relative_coordinate (c, Y_AXIS) - staff_sym_l_->relative_coordinate (c, Y_AXIS);
+
+      p += 2.0 * y / staff_line_leading_f ();
+    }
+  return  p;
+}
+
 
-  Graphical_element * c = common_refpoint (staff_sym_l_, Y_AXIS);
-  Real y = relative_coordinate (c, Y_AXIS) - staff_sym_l_->relative_coordinate (c, Y_AXIS);
 
-  return 2.0 * y / staff_line_leading_f ();
+void
+Staff_symbol_referencer::do_pre_processing ()
+{
+  translate_axis (position_i_ * staff_line_leading_f () /2.0, Y_AXIS);
+  position_i_ =0;
 }
 
+
+void
+Staff_symbol_referencer::set_position (int p)
+{
+  /*
+    UGH. Use position_f() as well. 
+   */
+  position_i_ =   p;
+  
+}
index c43916f4f188a1014e1357b8d3dc9d199c1c18b7..dd5ddb1c8a04bb99b6977f5b2b8e165842b2ba2c 100644 (file)
@@ -96,15 +96,8 @@ Stem_engraver::do_pre_move_processing()
 
   if (stem_p_)
     {
-      SCM prop = get_property ("verticalDirection", 0);
-      if (gh_number_p(prop))
-       {
-         stem_p_->set_direction (to_dir (prop));
-         stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);
-       }
-
       Translator_group* which;
-      prop = get_property ("stemLeftBeamCount", &which);
+      SCM prop = get_property ("stemLeftBeamCount", &which);
       if (gh_number_p(prop))
        {
          stem_p_->beams_i_drul_[LEFT] = gh_scm2int (prop);
@@ -116,6 +109,15 @@ Stem_engraver::do_pre_move_processing()
          stem_p_->beams_i_drul_[RIGHT] = gh_scm2int (prop);
          ((Translator_group*)which)->set_property ("stemRightBeamCount", SCM_UNDEFINED);
        }
+
+      // UGH. Should mark non-forced instead.
+      SCM dir = stem_p_->get_elt_property ("direction");
+      if (gh_number_p (dir) && gh_int2scm (dir))
+       {
+         stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);   
+       }
+
+
       typeset_element(stem_p_);
       stem_p_ = 0;
     }
index 178166d73be50bd3c4f82f3501510c6f573980cc..2975f3321afe187b6c8423c9b6297fcb2ad438f9 100644 (file)
 #include "beam.hh"
 #include "rest.hh"
 
-void
-Stem::set_direction (Direction d)
-{
-  if  (!get_direction ())
-    warning (_ ("stem direction set already!"));
-
-  dir_ = d;
-
-  /*
-    todo
-  */
-}
-
 Stem::Stem ()
 {
   beams_i_drul_[LEFT] = beams_i_drul_[RIGHT] = -1;
   yextent_drul_[DOWN] = yextent_drul_[UP] = 0;
   flag_i_ = 2;
-  set_direction (CENTER);
   beam_l_ = 0;
 }
 
index 49212b2d0939f28230ccf399fe5784d3c83d992e..876ca6070fcac5541743bfda711b1dc602fa539c 100644 (file)
@@ -136,18 +136,8 @@ Tie_engraver::do_pre_move_processing ()
     }
   now_heads_.clear ();
 
-  SCM dir (get_property ("tieVerticalDirection", 0));
-  SCM dir2 (get_property ("verticalDirection", 0));
-
-  Direction tie_dir = CENTER;
-  if (gh_number_p(dir))
-    tie_dir = to_dir (dir);
-  else if (isdir_b (dir2))
-    tie_dir = to_dir (dir2);
-  
   for (int i=0; i<  tie_p_arr_.size (); i++)
    {
-      tie_p_arr_[i]->set_direction (tie_dir);
       typeset_element (tie_p_arr_[i]);
     }
   tie_p_arr_.clear ();
index ef3942dd66576cf82a7927e22077c095c1b5be33..6f16728730735c25ce8006e0e96b3ba6f2e01094 100644 (file)
@@ -2,6 +2,8 @@
  chord modifiers
 %}
 
+#(eval-string (ly-gulp-file "chord-names.scm"))
+
 \chordmodifiers {
        m       = \musicalpitch { 0 2 -1 }
        min     = \musicalpitch { 0 2 -1 }
index 60174acd441b9d414b58f82bac744788b0d6c047..cd6f98cf44c6bb16522977e03bb8adb76e4a6a0e 100644 (file)
@@ -16,6 +16,26 @@ StaffContext=\translator {
  % Bar_engraver must be first so default bars aren't overwritten
 % with empty ones.
        \consists "Repeat_engraver";
+
+
+       %  name, glyph id, c0 position
+       supportedClefTypes = #'(
+         ("treble" "treble" -2)
+         ("violin" "treble" -2)
+         ("G" "treble" -2)
+         ("G2" "treble" -2)
+         ("french" "treble" -4 )
+         ("soprano" "alto" -4 )
+         ("mezzosoprano" "alto" -2 )
+         ("alto" "alto" 0 )
+         ("tenor" "alto" 2 )
+         ("baritone" "alto" 4 )
+         ("varbaritone" "bass" 0)
+         ("bass" "bass" 2 )
+         ("F" "bass" 2)
+         ("subbass" "bass" 4)
+       )
+       
        \consists "Clef_engraver";
        \consists "Key_engraver";
        \consists "Time_signature_engraver";
index 2026d92ba536c8371940c524855661a87fb907c9..25222f488d0047d34a24b163ce37a55e8476f743 100644 (file)
@@ -11,6 +11,7 @@ paper_eleven = \paper {
        font_large = 8.;
        font_Large = 6.;
        font_normal = 5.;
+       font_script = 4.;
 
        font_finger = 4.;
        font_volta = 4.;
@@ -18,10 +19,15 @@ paper_eleven = \paper {
        font_dynamic = 10.;
        font_mark = 6.;
        magnification_dynamic = -4.0;
+
        -1=\font "feta11"
        -2=\font "feta11"
        0=\font "feta11"
 
+       "font_feta-2" = 11.;
+       "font_feta-1" = 11.;
+       "font_feta" = 11.;
+
        \include "params.ly";
 }
 
index afe0cd5651acc36eabce1c512c3006f314085486..65d412981e976835751971599d4244a7c1c73303 100644 (file)
@@ -11,6 +11,7 @@ paper_thirteen = \paper {
        font_large = 8.;
        font_Large = 6.;
        font_normal = 5.;
+       font_script = 4.;
 
        font_finger = 4.;
        font_volta = 4.;
@@ -20,6 +21,10 @@ paper_thirteen = \paper {
 
        0=\font "feta13"
        -1=\font "feta11"
+
+       "font_feta-2" = 11.;
+       "font_feta-1" = 11.;
+       "font_feta" = 13.;
        
        \include "params.ly";
 }
index f9a2a248e3964d09a30e4a95f59a8338900502ea..14fab61a393479666a135adb1c1ed6496254bdf8 100644 (file)
@@ -14,6 +14,8 @@ paper_sixteen = \paper {
        font_large = 12.;
        font_Large = 10.;
        font_normal = 8.;
+       font_script = 7.;
+
        magnification_dynamic = 1.0;
        font_finger = 4.;
        font_volta = 5.;
@@ -25,6 +27,10 @@ paper_sixteen = \paper {
        -1 = \font "feta13"
        -2 = \font "feta11"
        
+       "font_feta-2" = 11.;
+       "font_feta-1" = 13.;
+       "font_feta" = 16.;
+
        \include "params.ly";
 }
 
index 24983c1710ba96fdfd5557bf34fa76cf07d65d95..65f9100c738c9db35f2dce3157633af33d16a548 100644 (file)
@@ -9,6 +9,7 @@ paper_twenty = \paper {
        font_large = 12.;
        font_Large = 12.;       
        font_normal = 10.;
+       font_script = 8.;
 
        font_finger = 5.;
        font_volta = 8.;
@@ -31,6 +32,10 @@ paper_twenty = \paper {
        -1 = \font "feta16"
        0 = \font "feta20"
 
+       "font_feta-2" = 13.;
+       "font_feta-1" = 16.;
+       "font_feta" = 20.;
+
        \include "params.ly";
 }
 
index 46a9f25b8fd6d38ef172a44ec45ee6ad44fc2da4..7a129b3356b4d107a2d813ba71e632a257f8eb6f 100644 (file)
@@ -9,6 +9,7 @@ paper_twentythree = \paper {
        font_large = 12.;
        font_Large = 12.;       
        font_normal = 10.;
+       font_script = 8.;
 
        font_finger = 5.;
        font_volta = 8.;
@@ -26,6 +27,10 @@ paper_twentythree = \paper {
        -1 = \font "feta20"
        0 = \font "feta23"
 
+       "font_feta-2" = 16.;
+       "font_feta-1" = 20.;
+       "font_feta" = 23.;
+
        \include "params.ly";
 }
 
index 84d29e891b63c7336b686821557e63e85f792c53..4842149001ac96897177d96bba57edbcdf6f9b39 100644 (file)
@@ -9,6 +9,8 @@ paper_twentysix = \paper {
        font_large = 14.;
        font_Large = 17.;       
        font_normal = 12.;
+       font_script = 10.;
+
        font_dynamic = 10.;
        % Ugh
        magnification_dynamic = 4.;
@@ -22,6 +24,11 @@ paper_twentysix = \paper {
        0=\font "feta26"
        -1 = \font "feta23"
        -2 = \font "feta20"
+
+       "font_feta-2" = 20.;
+       "font_feta-1" = 23.;
+       "font_feta" = 26.;
+
        \include "params.ly";
 }
 
index f8123bfe8e531e5292acf8bcdf1a67b481ee0c52..8e6f1832a70e8a710911b937fcd5ef627584068a 100644 (file)
@@ -96,6 +96,11 @@ grace_forced_stem_shorten3 = \grace_forced_stem_shorten2;
 #'beam-dir-algorithm = #'majority      %urg.
 
 
+#'Clef_item::visibility-lambda = #postbreak-only-visibility
+#'Key_item::visibility-lambda = #postbreak-only-visibility
+#'Breathing_sign::visibility-lambda = #non-postbreak-visibility
+
+
 %{
 dit(code(beam_dir_algorithm)) Specify algorithm for determining
 whether beams go up or down.  It is real valued.  If set to 2.0 then
index ddc99ba5078de2f4a7791bf45686df8fa330fd62..b056e3511126c42c57794a4d37758fb06387a708 100644 (file)
@@ -13,6 +13,7 @@ SEE THE REFERENCE MANUAL FOR EXPLANATIONS.
 %hmm, (these) abbrevs suck, imo
 % i guess they're meant as some form of doco
 % that's what i use them for...
+
 stemup =        \property Voice.verticalDirection = \up 
 stemboth=      \property Voice.verticalDirection = \center
 stemdown =     \property Voice.verticalDirection = \down
index 84bdabb4d07101e5329292fa931c8c4827eebdd9..c2b50d430f2214de3cbb1328a50dd80fa19713f6 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.3
-Entered-date: 03NOV99
+Version: 1.3.4
+Entered-date: 08NOV99
 Description: 
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.3.3.tar.gz 
+       1000k lilypond-1.3.4.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.3.tar.gz 
+       1000k lilypond-1.3.4.tar.gz 
 Copying-policy: GPL
 End
index 622db7d8708ac483596c511cfcb8c22bc98111fc..bb91ede12c1bd7fea62ff33044671fb9980eca01 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.3
+Version: 1.3.4
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.3.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.4.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>
diff --git a/scm/chord-names.scm b/scm/chord-names.scm
new file mode 100644 (file)
index 0000000..597679a
--- /dev/null
@@ -0,0 +1,67 @@
+;; pitch: (notename . accidental)
+;; list:  (list-of-pitches . (modifier-string . addition-subtraction-string))
+
+;; if a complete chord is found, use name
+;; if a chord's base triad is found (c e g), use name
+
+(define pitch-names-alist '())
+(set! pitch-names-alist
+      (append 
+      '(
+       ; use these for German naming
+       ;((6 . 0) . ("H" ""))
+       ;((6 . -1) . ("B" ("feta-1" . "\12")))
+
+       ; urg, temp hack for accidental size: can't set from Chord::
+       ((0 . 1) . ("C" ("feta-1" . "\10")))
+       ((1 . 1) . ("D" ("feta-1" . "\10")))
+       ((2 . 1) . ("E" ("feta-1" . "\10")))
+       ((3 . 1) . ("F" ("feta-1" . "\10")))
+       ((4 . 1) . ("G" ("feta-1" . "\10")))
+       ((5 . 1) . ("A" ("feta-1" . "\10")))
+       ((6 . 1) . ("B" ("feta-1" . "\10")))
+
+       ((0 . -1) . ("C" ("feta-1" . "\12")))
+       ((1 . -1) . ("D" ("feta-1" . "\12")))
+       ((2 . -1) . ("E" ("feta-1" . "\12")))
+       ((3 . -1) . ("F" ("feta-1" . "\12")))
+       ((4 . -1) . ("G" ("feta-1" . "\12")))
+       ((5 . -1) . ("A" ("feta-1" . "\12")))
+       ((6 . -1) . ("B" ("feta-1" . "\12")))
+       )
+      pitch-names-alist))
+
+(define (user-pitch-name pitch)
+  (let ((entry (assoc pitch pitch-names-alist)))
+       (if entry
+          (cdr entry))))
+
+(define chord-names-alist '())
+(set! chord-names-alist
+      (append 
+      '(
+       ; C iso C.no3.no5
+       (((0 . 0)) . ("" . ""))
+       ; C iso C.no5
+       (((0 . 0) (2 . 0)) . ("" . ""))
+       ; Cm iso Cm.no5
+       (((0 . 0) (2 . -1)) . ("m" . ""))
+       ; Cdim iso Cm5-
+       (((0 . 0) (2 . -1) (4 . -1)) . ("dim" . ""))
+       ; Co iso Cm5-7-
+       ; urg
+        ; (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("feta-1" . ".")))
+        (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("script" . "o")))
+       ; Cdim9
+       (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1)) . ("dim" . ("script" . "9")))
+       (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1) (3 . -1)) . ("dim" . ("script" . "11")))
+       )
+      chord-names-alist))
+
+(define (user-chord-name chord)
+  ;(display chord)
+  ;(newline)
+  (let ((entry (assoc chord chord-names-alist)))
+       (if entry
+          (cdr entry))))
+
index 463fad46e522e01d391437cb3c65aae19a65d413..88b6b6a3e19cae5729d7b18e240f0d436fd17e01 100644 (file)
@@ -15,6 +15,8 @@
 (define generic-stem-properties
   (cons "Stem"
        (list
+        (list 'stemVerticalDirection dir? 'direction)
+        (list 'verticalDirection dir? 'direction)       
         (list 'stemLength number? 'length)
         (list 'stemStyle string? 'style)
         (list 'noStemExtend boolean? 'no-stem-extend)
@@ -36,6 +38,8 @@
 (define generic-breathing-sign-properties
   (cons "Breathing_sign"
        (list
+        (list 'breathingSignVerticalDirection dir? 'direction)
+        (list 'verticalDirection dir? 'direction)
         (list 'breathingSignBreakPriority number? 'break-priority
          ))))
 
 (define generic-rest-properties
   (cons "Rest" (list (list 'restStyle string? 'reststyle))))
 
+(define generic-tie-properties
+  (cons "Tie" (list
+              (list 'tieVerticalDirection dir? 'direction)
+              (list 'verticalDirection dir? 'direction)
+  )))
+
+
 (define generic-note-column-properties
   (cons "Note_column"
        (list
@@ -63,6 +74,8 @@
 (define generic-slur-properties
   (cons "Slur"
        (list
+        (list 'slurVerticalDirection dir? 'direction)
+        (list 'verticalDirection dir? 'direction)       
         (list 'slurDash number? 'dashed))))
 
 (define generic-timesig-properties
index 980344441cd422a74c4270ca61b9be3d766206e2..a2bbdd35bcde4901ba097a7012fcc10857aee4a3 100644 (file)
 
 
 ;; See documentation of Item::visibility_lambda_
-(define (postbreak_only_visibility d) (if (= d 1) '(#f . #f) '(#t . #t)))
-(define (spanbar_non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
-
-(define (non_postbreak_visibility d) (if (= d 1) '(#t . #t) '(#f . #f)))
-(define (non_prebreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
+(define (postbreak-only-visibility d) (if (= d 1) '(#f . #f) '(#t . #t)))
+(define (spanbar-non-postbreak-visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
+(define (all-visibility d) '(#f . #f))
+(define (non-postbreak-visibility d) (if (= d 1) '(#t . #t) '(#f . #f)))
+(define (non-prebreak-visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
 
 
 ;; Score_span_bars are only visible at start of line
 ;; i.e. if break_dir == RIGHT == 1
-(define Span_bar_engraver_visibility non_postbreak_visibility)
-(define mark-visibility non_prebreak_visibility)
-(define Span_score_bar_engraver_visibility postbreak_only_visibility)
-(define Piano_bar_engraver_visibility postbreak_only_visibility)
-(define Staff_group_bar_engraver_visibility postbreak_only_visibility)
+(define Span_bar_engraver-visibility non-postbreak-visibility)
+(define mark-visibility non-prebreak-visibility)
+(define Span_score_bar_engraver-visibility postbreak-only-visibility)
+(define Piano_bar_engraver-visibility postbreak-only-visibility)
+(define Staff_group_bar_engraver-visibility postbreak-only-visibility)
 
 ;; Spacing constants for prefatory matter.
 ;;
 
 ;;;;;;;; TeX
 
+;; this is silly, can't we use something like
+;; roman-0, roman-1 roman+1 ?
 (define cmr-alist 
   '(("bold" . "cmbx") 
     ("dynamic" . "feta-din") 
+    ("feta" . "feta") 
+    ("feta-1" . "feta") 
+    ("feta-2" . "feta") 
     ("finger" . "feta-nummer") 
     ("typewriter" . "cmtt") 
     ("italic" . "cmti") 
     ("roman" . "cmr") 
+    ("script" . "cmr") 
     ("large" . "cmbx") 
     ("Large" . "cmbx") 
     ("mark" . "feta-nummer") 
    ((string? exp) (string-append "\"" exp "\""))
    ))
 
-(define (test-scm->string)
-(list (scmlist->string '(a))
-(scmlist->string '(a b))
-(scmlist->string '(a b . c))
-
-
-(scm->string '(a))
-(scm->string '(a b ))
-(scm->string '(a b . c))
-(scm->string '(a b (c . d)))
-(scm->string '(a "bla" (c . 1.5)))
-)
-)