From 2b0aa2c5bbb4af4e7d0d3c057de066dc1d6d6b8d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 8 Nov 1999 16:24:17 +0100 Subject: [PATCH] release: 1.3.4 --- CHANGES | 22 ++ Documentation/topdocs/index.tely | 42 ++- TODO | 76 ++--- VERSION | 2 +- flower/include/array.hh | 4 +- flower/include/array.icc | 4 +- input/test/banter-chords.ly | 66 ++++ input/test/chords.ly | 4 +- input/test/staff-line-leading.ly | 4 +- lily/bar-number-engraver.cc | 2 +- lily/bar-script-engraver.cc | 4 +- lily/base-span-bar-engraver.cc | 2 +- lily/beam.cc | 2 +- lily/breathing-sign-engraver.cc | 4 - lily/breathing-sign.cc | 9 - lily/chord-name-engraver.cc | 29 +- lily/chord.cc | 410 +++++++++++++++++------- lily/clef-engraver.cc | 67 ++-- lily/clef-item.cc | 4 +- lily/directional-element.cc | 32 ++ lily/directional-spanner.cc | 4 - lily/dot-column.cc | 11 +- lily/dots.cc | 3 +- lily/include/breathing-sign.hh | 13 +- lily/include/chord-name-engraver.hh | 3 +- lily/include/chord.hh | 35 +- lily/include/clef-item.hh | 1 - lily/include/directional-element.hh | 25 ++ lily/include/directional-spanner.hh | 10 +- lily/include/dots.hh | 1 - lily/include/paper-def.hh | 3 + lily/include/rest.hh | 1 - lily/include/rhythmic-head.hh | 4 +- lily/include/staff-bar.hh | 3 +- lily/include/staff-side.hh | 9 +- lily/include/staff-symbol-referencer.hh | 6 +- lily/include/stem.hh | 10 +- lily/key-engraver.cc | 4 +- lily/lily-guile.cc | 13 + lily/note-head.cc | 4 +- lily/note-heads-engraver.cc | 2 +- lily/paper-outputter.cc | 11 +- lily/pitch-squash-engraver.cc | 2 +- lily/property-inspect.cc | 2 +- lily/rest.cc | 18 +- lily/rhythmic-head.cc | 16 +- lily/slur-engraver.cc | 10 - lily/spacing-spanner.cc | 2 +- lily/staff-bar.cc | 6 + lily/staff-margin-engraver.cc | 2 +- lily/staff-side.cc | 1 - lily/staff-symbol-referencer.cc | 32 +- lily/stem-engraver.cc | 18 +- lily/stem.cc | 14 - lily/tie-engraver.cc | 10 - ly/chord-modifiers.ly | 2 + ly/engraver.ly | 20 ++ ly/paper11.ly | 6 + ly/paper13.ly | 5 + ly/paper16.ly | 6 + ly/paper20.ly | 5 + ly/paper23.ly | 5 + ly/paper26.ly | 7 + ly/params.ly | 5 + ly/property.ly | 1 + make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- scm/chord-names.scm | 67 ++++ scm/generic-property.scm | 13 + scm/lily.scm | 39 +-- 70 files changed, 852 insertions(+), 439 deletions(-) create mode 100644 input/test/banter-chords.ly create mode 100644 lily/directional-element.cc create mode 100644 lily/include/directional-element.hh create mode 100644 scm/chord-names.scm diff --git a/CHANGES b/CHANGES index a236328eae..81585aa915 100644 --- 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. diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index e0044f3284..dc1e42e5ff 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -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 07f05fc75b..f21b67e5dc 100644 --- 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; } { } > @@ -515,15 +502,6 @@ hesitate to ask. . * input property . * Figure out semicolons. . * 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 5b55b3beb1..3262ab2017 100644 --- 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 diff --git a/flower/include/array.hh b/flower/include/array.hh index d6349588aa..f8f6e352fd 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -13,7 +13,7 @@ #endif /// copy a bare (C-)array from #src# to #dest# sized #count# -template void arrcpy (T*dest, T*src, int count); +template 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 slice (int lower, int upper) ; + Array slice (int lower, int upper) const; void reverse(); }; diff --git a/flower/include/array.icc b/flower/include/array.icc index 8b876ce85d..71de84a8ac 100644 --- a/flower/include/array.icc +++ b/flower/include/array.icc @@ -19,7 +19,7 @@ */ template 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::remove_array_p () template INLINE Array -Array::slice (int lower, int upper) +Array::slice (int lower, int upper) const { assert (lower >= 0 && lower <=upper&& upper <= size_); Array r; diff --git a/input/test/banter-chords.ly b/input/test/banter-chords.ly new file mode 100644 index 0000000000..307b8656fa --- /dev/null +++ b/input/test/banter-chords.ly @@ -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" . ""))) + ) + 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 + > +} + diff --git a/input/test/chords.ly b/input/test/chords.ly index c74d502430..cf6251d30d 100644 --- a/input/test/chords.ly +++ b/input/test/chords.ly @@ -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 diff --git a/input/test/staff-line-leading.ly b/input/test/staff-line-leading.ly index 03a5daf1d5..dbf97cf071 100644 --- a/input/test/staff-line-leading.ly +++ b/input/test/staff-line-leading.ly @@ -2,7 +2,9 @@ \notes \relative c'' \context GrandStaff < \context Staff = up { c4 c4 } \context Staff = down { \property Staff. staffLineLeading = #5.5 c4 - + [ + e] + [f c'] } > } diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 2db31f2b91..e7df04ae89 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -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 diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index 21de711e9a..c8becdc046 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -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", diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc index 53800c6681..24ba35b14b 100644 --- a/lily/base-span-bar-engraver.cc +++ b/lily/base-span-bar-engraver.cc @@ -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())); diff --git a/lily/beam.cc b/lily/beam.cc index 0d7b93157f..64ab8ea41f 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -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 set_vertical_position(to_dir (prop)); - announce_element (Score_element_info (breathing_sign_p_, breathing_sign_req_l_)); } } diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 2e6ebde757..3578e06210 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -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 diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index ef0744d627..21f0a99f1a 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -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; diff --git a/lily/chord.cc b/lily/chord.cc index adef8d4991..8dbc57a6c7 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -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* add_arr_p, Array* 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* add_arr_p, Array* add_arr_p, Array 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 +Chord::base_arr (Musical_pitch p) +{ + Array 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* pitch_arr_p, Musical_pitch tonic) +Chord::rebuild_transpose (Array* 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 - if (q.notename_i_ == 6) - q.accidental_i_--; p.transpose (q); + // duh, c7 should mean + 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* add_arr_p, Array* sub_arr_p) const +Chord::find_additions_and_subtractions (Array pitch_arr, Array* add_arr_p, Array* 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 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 * add_arr_p, Array* add_arr_p, Arraypush (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 pitch_arr, Chord_name* name_p) const +{ + SCM chord = SCM_EOL; + Array 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 pitch_arr, Chord_name* name_p) const +{ Array add_arr; Array sub_arr; - find_additions_and_subtractions (&add_arr, &sub_arr); + find_additions_and_subtractions (pitch_arr, &add_arr, &sub_arr); - Array 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 const* pitch_arr_p) { @@ -648,3 +762,83 @@ Chord::rebuild_with_bass (Array* 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 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 +} diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 4c7eb954c6..deaac87548 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -8,6 +8,9 @@ Mats Bengtsson */ +/* + CLEAN ME UP. + */ #include #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(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(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 (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; } } diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 168a1e45e9..6503c3a1d5 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -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 index 0000000000..7d9e9a666a --- /dev/null +++ b/lily/directional-element.cc @@ -0,0 +1,32 @@ +/* + directional-element.cc -- implement Directional_element + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#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)); +} diff --git a/lily/directional-spanner.cc b/lily/directional-spanner.cc index be9676c4d1..1ef4574bd9 100644 --- a/lily/directional-spanner.cc +++ b/lily/directional-spanner.cc @@ -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 diff --git a/lily/dot-column.cc b/lily/dot-column.cc index d510fba7f4..3d3f73f410 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -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 position_i_ = pos; + dot_l_arr_[i]->set_position(pos); } } diff --git a/lily/dots.cc b/lily/dots.cc index 43dac77057..d4c8e62eed 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -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 (); diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index 6e861a905c..0378d62078 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -13,23 +13,24 @@ #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 diff --git a/lily/include/chord-name-engraver.hh b/lily/include/chord-name-engraver.hh index 4843fae8e9..f5e52ee782 100644 --- a/lily/include/chord-name-engraver.hh +++ b/lily/include/chord-name-engraver.hh @@ -28,8 +28,7 @@ protected: private: Array pitch_arr_; - Link_array text_p_arr_; - Array rebuild_pitch_arr (int tonic_i) const; + Chord* chord_p_; Tonic_req* tonic_req_; Inversion_req* inversion_req_; Bass_req* bass_req_; diff --git a/lily/include/chord.hh b/lily/include/chord.hh index 871189fafc..e568f70985 100644 --- a/lily/include/chord.hh +++ b/lily/include/chord.hh @@ -12,33 +12,56 @@ #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 base_arr (Musical_pitch p); static int find_tonic_i (Array const*); static int find_pitch_i (Array const*, Musical_pitch p); static int find_notename_i (Array const*, Musical_pitch p); static Array missing_thirds_pitch_arr (Array const* pitch_arr_p); static void rebuild_from_base (Array*, int base_i); static void rebuild_insert_inversion (Array*, int tonic_i); - static void rebuild_transpose (Array*, Musical_pitch tonic); + static void rebuild_transpose (Array*, Musical_pitch tonic, bool fix7_b); static void rebuild_with_bass (Array*, int bass_i); static int step_i (Musical_pitch tonic, Musical_pitch p); Chord (Array pitch_arr, Musical_pitch* inversion_p, Musical_pitch* bass_p); - Chord (Chord const& chord); - ~Chord (); + Chord (Chord const&); + virtual ~Chord (); Array to_pitch_arr () const; - String banter_str () const; - void find_additions_and_subtractions(Array* add_arr_p, Array* sub_arr_p) const; + void find_additions_and_subtractions(Array pitch_arr, Array* add_arr_p, Array* 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 pitch_arr, Chord_name* name_p) const; + void banter (Array pitch_arr, Chord_name* name_p) const; Array 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* add_arr_p, Array* sub_arr_p, Musical_pitch* inversion_p, Musical_pitch* bass_p); diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index c37277e312..11362d72fa 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -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 index 0000000000..a94bfced9d --- /dev/null +++ b/lily/include/directional-element.hh @@ -0,0 +1,25 @@ +/* + directional-element.hh -- declare Directional_element + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#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 */ + diff --git a/lily/include/directional-spanner.hh b/lily/include/directional-spanner.hh index cdc56a4ed1..93d226fdaa 100644 --- a/lily/include/directional-spanner.hh +++ b/lily/include/directional-spanner.hh @@ -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; diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 29e1bd5b11..2806cb1cc4 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -23,7 +23,6 @@ protected: virtual void do_post_processing (); public: int dots_i_; - int position_i_; Direction resolve_dir_; Dots (); diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index f939347094..310cfd29d0 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -54,6 +54,9 @@ public: virtual ~Paper_def (); Array shape_int_a_; + /* + JUNKME + */ Real get_realvar (SCM symbol) const; Real get_var (String id) const; diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 611ddd7103..39b6bb2b20 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -15,7 +15,6 @@ class Rest : public Rhythmic_head { public: - Rest (); void add_dots (Dots*); protected: virtual void do_add_processing (); diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 7f792787db..3d912e0cb0 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -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*); }; diff --git a/lily/include/staff-bar.hh b/lily/include/staff-bar.hh index 4f604ad080..171ec1ddc0 100644 --- a/lily/include/staff-bar.hh +++ b/lily/include/staff-bar.hh @@ -17,9 +17,10 @@ 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; }; diff --git a/lily/include/staff-side.hh b/lily/include/staff-side.hh index 36441beefa..81510632aa 100644 --- a/lily/include/staff-side.hh +++ b/lily/include/staff-side.hh @@ -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 @@ -25,16 +26,14 @@ 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 support_l_arr_; Axis axis_; diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index 255c57abcc..5fc62e0ed0 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -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; }; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 2d91e441e9..411848696b 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -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: @@ -41,19 +42,16 @@ */ // 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 yextent_drul_; - /// direction stem (that's me) - Direction dir_; - public: - void set_direction (Direction d); - Direction get_direction () const { return dir_; } Link_array head_l_arr_; Link_array rest_l_arr_; diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index e5c53f74f8..c7b1675fa1 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -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")); } } diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 7fd60380af..2ecad9547a 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -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); diff --git a/lily/note-head.cc b/lily/note-head.cc index faad356297..a8ee5f3f9a 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -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); diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 74168092d4..3ce360fed0 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -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. diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 9dd7d28729..14316cad02 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -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); diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index eb3e1bc16b..8218ff66c9 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -15,7 +15,7 @@ Pitch_squash_engraver::acknowledge_element (Score_element_info i) { if (Note_head *nh = dynamic_cast (i.elem_l_)) { - nh->position_i_ =0; + nh->set_position(0); } } diff --git a/lily/property-inspect.cc b/lily/property-inspect.cc index 57093f8bce..af4e5a607d 100644 --- a/lily/property-inspect.cc +++ b/lily/property-inspect.cc @@ -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; diff --git a/lily/rest.cc b/lily/rest.cc index 7a3e5fab03..a7974c5ead 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -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; diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 2f1a10197d..0698b0c3cf 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -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 diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 6795c9d01f..ae15cd1d65 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -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(); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index cb7eb9b4d4..ece98451f7 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -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) diff --git a/lily/staff-bar.cc b/lily/staff-bar.cc index 00e71d2282..55167bbd32 100644 --- a/lily/staff-bar.cc +++ b/lily/staff-bar.cc @@ -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 (); +} diff --git a/lily/staff-margin-engraver.cc b/lily/staff-margin-engraver.cc index a382bf84b1..13c9c7f9e6 100644 --- a/lily/staff-margin-engraver.cc +++ b/lily/staff-margin-engraver.cc @@ -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"); } diff --git a/lily/staff-side.cc b/lily/staff-side.cc index 5f923b89d8..5e737330a0 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -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; diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 2af11bc5f7..2c6a3a17bc 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -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; + +} diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index c43916f4f1..dd5ddb1c8a 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -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; } diff --git a/lily/stem.cc b/lily/stem.cc index 178166d73b..2975f3321a 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -19,25 +19,11 @@ #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; } diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 49212b2d09..876ca6070f 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -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 (); diff --git a/ly/chord-modifiers.ly b/ly/chord-modifiers.ly index ef3942dd66..6f16728730 100644 --- a/ly/chord-modifiers.ly +++ b/ly/chord-modifiers.ly @@ -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 } diff --git a/ly/engraver.ly b/ly/engraver.ly index 60174acd44..cd6f98cf44 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -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"; diff --git a/ly/paper11.ly b/ly/paper11.ly index 2026d92ba5..25222f488d 100644 --- a/ly/paper11.ly +++ b/ly/paper11.ly @@ -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"; } diff --git a/ly/paper13.ly b/ly/paper13.ly index afe0cd5651..65d412981e 100644 --- a/ly/paper13.ly +++ b/ly/paper13.ly @@ -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"; } diff --git a/ly/paper16.ly b/ly/paper16.ly index f9a2a248e3..14fab61a39 100644 --- a/ly/paper16.ly +++ b/ly/paper16.ly @@ -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"; } diff --git a/ly/paper20.ly b/ly/paper20.ly index 24983c1710..65f9100c73 100644 --- a/ly/paper20.ly +++ b/ly/paper20.ly @@ -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"; } diff --git a/ly/paper23.ly b/ly/paper23.ly index 46a9f25b8f..7a129b3356 100644 --- a/ly/paper23.ly +++ b/ly/paper23.ly @@ -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"; } diff --git a/ly/paper26.ly b/ly/paper26.ly index 84d29e891b..4842149001 100644 --- a/ly/paper26.ly +++ b/ly/paper26.ly @@ -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"; } diff --git a/ly/params.ly b/ly/params.ly index f8123bfe8e..8e6f1832a7 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -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 diff --git a/ly/property.ly b/ly/property.ly index ddc99ba507..b056e35111 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -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 diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 84bdabb4d0..c2b50d430f 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -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 diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 622db7d870..bb91ede12c 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -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 diff --git a/scm/chord-names.scm b/scm/chord-names.scm new file mode 100644 index 0000000000..597679a2cf --- /dev/null +++ b/scm/chord-names.scm @@ -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" . ""))) + + ; urg, temp hack for accidental size: can't set from Chord:: + ((0 . 1) . ("C" ("feta-1" . ""))) + ((1 . 1) . ("D" ("feta-1" . ""))) + ((2 . 1) . ("E" ("feta-1" . ""))) + ((3 . 1) . ("F" ("feta-1" . ""))) + ((4 . 1) . ("G" ("feta-1" . ""))) + ((5 . 1) . ("A" ("feta-1" . ""))) + ((6 . 1) . ("B" ("feta-1" . ""))) + + ((0 . -1) . ("C" ("feta-1" . ""))) + ((1 . -1) . ("D" ("feta-1" . ""))) + ((2 . -1) . ("E" ("feta-1" . ""))) + ((3 . -1) . ("F" ("feta-1" . ""))) + ((4 . -1) . ("G" ("feta-1" . ""))) + ((5 . -1) . ("A" ("feta-1" . ""))) + ((6 . -1) . ("B" ("feta-1" . ""))) + ) + 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)))) + diff --git a/scm/generic-property.scm b/scm/generic-property.scm index 463fad46e5..88b6b6a3e1 100644 --- a/scm/generic-property.scm +++ b/scm/generic-property.scm @@ -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 )))) @@ -53,6 +57,13 @@ (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 diff --git a/scm/lily.scm b/scm/lily.scm index 980344441c..a2bbdd35bc 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -67,20 +67,20 @@ ;; 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. ;; @@ -132,13 +132,19 @@ ;;;;;;;; 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") @@ -657,16 +663,3 @@ ((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))) -) -) -- 2.39.2