From b87927d05effe5c67c675621672b351a29fd7235 Mon Sep 17 00:00:00 2001 From: Mats Bengtsson Date: Thu, 22 Oct 1998 01:01:13 +0200 Subject: [PATCH] patch::: 1.0.17.mb2: Re: LilyPond 1.0.17 pl 17.mb2 - Full support for cautionary accidentals. Try input/test/accid.fly Note that the font has changed. --- Documentation/tex/refman.yo | 8 +++++--- NEWS | 4 ++++ TODO | 2 -- VERSION | 2 +- input/test/accid.fly | 6 ++++++ lily/include/lookup.hh | 2 +- lily/include/musical-pitch.hh | 2 ++ lily/key-item.cc | 4 ++-- lily/local-key-engraver.cc | 3 +-- lily/local-key-item.cc | 3 ++- lily/lookup.cc | 16 ++++++++++++++-- lily/musical-pitch.cc | 1 + mf/feta-toevallig.mf | 33 +++++++++++++++++++++++++++++++-- tex/lilyponddefs.tex | 2 +- 14 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 input/test/accid.fly diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index aee4718c24..7a2e4ec17a 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -347,7 +347,7 @@ label(notedesc) subsect(Basic Note Specification) A note specification has the form -var(pitch)[var(octavespec)][code(!)][var(duration)]. +var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)]. The pitch of the note is specified by the note's name. LilyPond has predefined note names for various languages. The default @@ -395,9 +395,11 @@ will determine what accidentals to typeset depending on the key and context. A reminder accidental can be forced by using the optional exclamation mark `code(!)' -on a pitch. +on the pitch. +A cautionary accidental, i.e., an accidental within paranthesis +can be obtained using the optional question mark `code(?)' on the pitch. mudela(fragment,verbatim,center)( -cis' d' e' cis' c'! d' e' c' +cis' d' e' cis' c'? d' e' c'! ) diff --git a/NEWS b/NEWS index b9549a6e24..ede37bf592 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +pl 17.mb2 + - Full support for cautionary accidentals. Try input/test/accid.fly + Note that the font has changed. + pl 17.mb1 - bf: No unnecessary warnings about time signatures - Added optional second argument of \key. Set to \major or \minor diff --git a/TODO b/TODO index 57fddc2402..4ea9f0da55 100644 --- a/TODO +++ b/TODO @@ -270,8 +270,6 @@ ydirection and hshift preset * integrate midi-elts from mi2mu and lily? - * cautionary accidental - * score-bar-scripts FMR: Free memory read: * This is occurring while in: diff --git a/VERSION b/VERSION index 4644aeabd9..330a5ed09c 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=0 PATCH_LEVEL=17 -MY_PATCH_LEVEL=mb1 +MY_PATCH_LEVEL=mb2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/accid.fly b/input/test/accid.fly new file mode 100644 index 0000000000..d7a7775c42 --- /dev/null +++ b/input/test/accid.fly @@ -0,0 +1,6 @@ +\time 3/4; +cisis'' cisis! cisis? | +cis cis! cis? | +c c! c? | +ces ces! ces? | +ceses ceses! ceses? | diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 23c9011fa4..2e1997cfc1 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -29,7 +29,7 @@ public: Lookup (Symtables const&); virtual ~Lookup (); - Atom accidental (int) const; + Atom accidental (int,bool) const; void add (String, Symtable*); virtual Atom afm_find (String s, bool warn=true) const = 0; Atom afm_find (String, String, bool warn=true) const; diff --git a/lily/include/musical-pitch.hh b/lily/include/musical-pitch.hh index 2c4f1a55de..a46471fd61 100644 --- a/lily/include/musical-pitch.hh +++ b/lily/include/musical-pitch.hh @@ -29,6 +29,8 @@ struct Musical_pitch : public Input int octave_i_; /// 0 natural, 1 sharp, etc int accidental_i_; + /// Used for cautionary accidentals + bool cautionary_b_; void init () ; Musical_pitch to_relative_octave (Musical_pitch); diff --git a/lily/key-item.cc b/lily/key-item.cc index 80e470f10f..44fa94eaee 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -133,7 +133,7 @@ Key_item::brew_molecule_p() const || (old_pitch_arr_[i] == pitch_arr_[j] && old_acc_arr_[i] != acc_arr_[j])) { - Atom a =lookup_l ()->accidental (0); + Atom a =lookup_l ()->accidental (0,false); a.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS); Molecule m (a); output->add_at_edge (X_AXIS, RIGHT, m); @@ -153,7 +153,7 @@ Key_item::brew_molecule_p() const for (int i =0; i < pitch_arr_.size(); i++) { - Atom a =lookup_l ()->accidental (acc_arr_[i]); + Atom a =lookup_l ()->accidental (acc_arr_[i],false); a.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS); Molecule m (a); output->add_at_edge (X_AXIS, RIGHT, m); diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index a74b27d79e..93098e2293 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -67,10 +67,9 @@ Local_key_engraver::process_acknowledged () key_item_p_ = new Local_key_item; announce_element (Score_element_info (key_item_p_, 0)); } - ///////// TODO: Handle cautionary accidentals if (note_l->cautionary_b_) { - warning (_("cautionary accidentals are not yet supported")); + note_l->pitch_.cautionary_b_ = true; } key_item_p_->add (note_l->pitch_); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 2b2d0dd5db..3932105466 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -70,7 +70,8 @@ Local_key_item::brew_molecule_p() const Real dy = (c0_position_i_ + accidental_pitch_arr_[i].notename_i_) * paper()->internote_f (); - Atom a (lookup_l ()->accidental (accidental_pitch_arr_[i].accidental_i_)); + Atom a (lookup_l ()->accidental (accidental_pitch_arr_[i].accidental_i_, + accidental_pitch_arr_[i].cautionary_b_)); a.translate_axis (dy, Y_AXIS); Molecule m(a); diff --git a/lily/lookup.cc b/lily/lookup.cc index bc8d12d71f..971e9380d7 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -53,9 +53,21 @@ Lookup::~Lookup () } Atom -Lookup::accidental (int j) const +Lookup::accidental (int j, bool cautionary) const { - return afm_find (String ("accidentals") + String ("-") + to_str (j)); + Atom a = afm_find (String ("accidentals") + String ("-") + to_str (j)); + if (cautionary) + { + Box b=a.extent(); + Atom lparen = afm_find (String ("accidentals") + String ("-(")); + lparen.translate_axis(b.x().min(),X_AXIS); + b.unite(lparen.extent()); + Atom rparen = afm_find (String ("accidentals") + String ("-)")); + rparen.translate_axis(b.x().max(),X_AXIS); + b.unite(rparen.extent()); + a = Atom(lparen.str_ + a.str_ + rparen.str_, b); + } + return a; } void diff --git a/lily/musical-pitch.cc b/lily/musical-pitch.cc index e7ffbd7014..9603e025d9 100644 --- a/lily/musical-pitch.cc +++ b/lily/musical-pitch.cc @@ -21,6 +21,7 @@ Musical_pitch::init () notename_i_ = 0; octave_i_ = 0; accidental_i_ = 0; + cautionary_b_ = false; } void diff --git a/mf/feta-toevallig.mf b/mf/feta-toevallig.mf index 7da404d0c7..3477b5d322 100644 --- a/mf/feta-toevallig.mf +++ b/mf/feta-toevallig.mf @@ -247,8 +247,37 @@ fet_beginchar("Double sharp", "2", "sharpsharp") currentpicture := currentpicture shifted (w/2,0); - fet_endchar; - +fet_endchar; + + +def draw_paren = + save leftindent; + leftindent# := .2 interline#; + define_pixels(leftindent); + set_char_box(0, .5 interline#+stafflinethickness#, + interline#, interline#); + z1 = (leftindent,h); + z2 = (w-stafflinethickness,0); + z3 = (leftindent,-d); + + penpos1(stafflinethickness, 35); + penpos2(2 stafflinethickness, 0); + penpos3(stafflinethickness, -35); + + penlabels(1,2,3); + fill z2l{down} .. simple_serif(z3l, z3r, 90) .. z2r{up} + .. simple_serif(z1r, z1l, 90) .. z2l{down} -- cycle; +enddef; + +fet_beginchar("Right paranthesis", ")", "rightparen") + draw_paren; +fet_endchar; + +fet_beginchar("Left paranthesis", "(", "leftparen") + draw_paren; + currentpicture := currentpicture xscaled -1; + set_char_box(charwd, charbp, chardp, charht); +fet_endchar; fet_endgroup("accidentals"); diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 38ea9553e8..4312a117a8 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -165,7 +165,7 @@ %compatibility %urg -\fetdef\repeatcolon{18} +\fetdef\repeatcolon{20} \def\repeatbar{\repeatstopbar} \def\startrepeat{\repeatstartbar} \def\repeatbarstartrepeat{\repeatstopstart} -- 2.39.5