-1.3.50.jcn1
-===========
+1.3.50
+======
+
+* Item cleanups. Copying items and rearranging pointers are done in
+separate passes, which makes the code cleaner. This fixes a problem
+with some items not disappearing from hara-kiri staffs.
+
+* Use Scheme for Key_item data members.
* Don't use regex in chord-names.scm under windows; hybrid chordnames
user+calculated will be partly broken.
-1.3.49.hwn2
-===========
+
+1.3.50
+======
* Junked Shift_tuple from collision; Now it uses SCM.
The version numbers are in Linux-kernel style: even numbered versions
are `stable'. The webpages for the stable version (1.2) reside at GNU,
here: @uref{http://www.gnu.org/software/lilypond}. Big enhancements go
-into the latest odd numbered version (1.3); its webpages are on
+into the latest odd numbered version (1.3), whose webpages are on
@uref{http://www.cs.uu.nl/~hanwen/lilypond/,Han-Wen's site}.
If want more information, you can browse the
listed in the @uref{Documentation/topdocs/out-www/INSTALL.html,
installation instructions}.
-There are binaries available, but alas they are not updated for every version released.
+Binaries are available, but are not updated for every version released.
@itemize @bullet
@item RedHat-i386 and Linuxppc RPMs:
@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/}
subscribe: send mail with subject "subscribe" to
info-gnu-music-request@@gnu.org.
- As this list is moderated, normal people should ask to
+ This list is moderated; ask
@email{drl@@gnu.org, David R. Linn} or
- @email{hanwen@@cs.uu.nl, Han-Wen} to forward announces instead of
- sending it to info-gnu-music@@gnu.org
+ @email{hanwen@@cs.uu.nl, Han-Wen} to send announcements for this
+list.
This list is archived at
@uref{http://www.mail-archive.com/info-gnu-music@@gnu.org}
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=50
-MY_PATCH_LEVEL=jcn1
+PATCH_LEVEL=51
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
{
sol[i] -= sub;
+#ifdef PARANOID
assert (fabs (eval (sol[i]) ) < 1e-8);
+#endif
}
return sol;
+++ /dev/null
-\clef "violin"; c' c \clef "alto"; d, d
-\clef "violin"; c' c \clef "alto"; d, d
--- /dev/null
+
+\score {
+ {
+ \context Staff = i {
+ \notes { a' b' c' d' }
+ }
+
+ \break
+
+ \context PianoStaff <
+ \context Staff = i {
+ \notes { a' b' c' d' }
+ }
+ \context Staff = ii {
+ \notes { \clef "bass"; a b c d }
+ }
+ >
+ }
+}
+++ /dev/null
-
-praeludium_commands = \notes {
- \time 4/4;
- \key e;
-}
-
-praeludium_right = \notes {
- \$praeludium_commands
- \clef violin;
-
- % 13 -- how to type -- where to split -- this more neatly?
- \context Staff <
- \context Voice = I \relative c'' { \stemup r4 dis4 e4. e8 ~ |
- \shifton e4 [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] |
- fis4 ~ [fis8 e16 dis] e4 r8 e8 }
- \context Voice = III \relative c'' { \stemup \shifton r4 bis cis \shiftoff cis |
- a' ~ [a16 gis a b] \shifton dis,4 cis ~ |
- [cis8 dis16 ais] bis4 cis r8 b }
- \context Voice = IV \relative c'' {
-
- %\stemup
- %{
- this is a diversion from the Griepenkerl/Keller
- edition; a hack to avoid collisions
- %}
- \stemdown
- \shifton s4 gis }
-
- \context Voice = II \relative c' { \stemdown
-% \shifton % idem
-
- r4 fis \shiftoff gis gis |
- a4. cis8 gis2 |
- fis4 gis gis r8 e8 }
- > |
- % 16
-}
-
-praeludium_left = \notes \relative c {
- \$praeludium_commands
- \clef bass;
-
- % 13
- \context Staff <
- \context VoiceTwo { r4 }
- \context VoiceOne { \stemup s4 dis' cis cis ~ |
- [cis8 a d cis] [bis gis] cis4 |
- dis2 cis4 r8 cis }
- \context VoiceOne { \stemup bis2 }
- \context VoiceThree { \stemup \shifton r4 gis ~ [gis8 gis] ~ \stemdown \shiftoff gis4 |
- a4. fis8 gis4. a8 ~ |
- a4 gis4 gis r8 gis }
-% { \stemup \shifton s4 fis4 e}
-% a quick hack to avoid some collisons
- \context VoiceFour { \stemdown \shifton s4 fis4 e}
- \context VoiceTwo { \stemdown s4 dis4 cis4 }
- > |
- %16
-}
-
-praeludium_pedal = \notes \relative c{
- \$praeludium_commands
- \clef bass;
-
- %13
- r4 fis,4-\ltoe e4.-\lheel e'8-\rheel |
- fis4.-\rtoe fis8-\rtoe fis4-\rtoe [e8-\ltoe a-\rtoe] |
- dis,4-\ltoe gis-\rtoe [cis,8-\ltoe b!-\lheel ais-\rtoe gis-\ltoe] |
- %16
-}
-
-
-fugaII_commands = \notes{
- \time3/4;
- \key e; % E-major
-}
-
-fugaII_right = \notes \relative c'' {
- \$fugaII_commands
- \clef violin;
-
- %15
- \context Staff <
- \context Voice = VA { \stemup [b8 fis8] b4 }
- \context Voice = VB { \stemdown fis2 }
- >
-
- % Wadieuw
- \context Staff \notes\relative c''<
- \context Voice=one {
- \property Voice.horizontalNoteShift=0
- \property Voice.verticalDirection=1
- e4
- }
- \context Voice=two {
- \property Voice.verticalDirection=1
- \property Voice.horizontalNoteShift=1
- cis
- }
- \context Voice=three {
- \property Voice.horizontalNoteShift=2
- \property Voice.verticalDirection=1
- ais
- }
- \context Voice=four {
- \property Voice.verticalDirection=-1
- \property Voice.horizontalNoteShift=-1
- fis
- }
- >
-
- %16
- \context Staff <
- \context VoiceOne { dis2 dis4 |
- cis2 cis4 |
- b4. [cis8 dis e] }
- \context VoiceThree { \stemup \shifton [b8 fis] b2 ~ |
- [b8 a!16 gis] a2 ~ |
- a4 gis2 }
- \context VoiceTwo { \stemdown fis2. ~ |
- fis ~ |
- fis4 e2 }
- > |
- %19
-}
-
-fugaII_left = \notes {
- \$fugaII_commands
- \clef bass;
-
- %15
- \context Staff <
- \context VoiceTwo { \stemdown b2 \stemup ais4 |
- b2 b4 }
- \context VoiceTwo { \stemdown s2 e4 |
- fis2 fis4 }
- >
- \stemdown cis2 e4 |
- b4. b8 b4 |
- %19
-}
-
-fugaII_pedal = \notes \relative c {
- \$fugaII_commands
- \clef bass;
-
- %15
- dis4.-\ltoe e8-\rtoe cis4 |
- b4.-\lheel [cis8-\ltoe dis8-\rtoe e8-\rheel] |
- fis4.-\rtoe [e8-\rheel dis8-\rtoe cis8-\ltoe] |
- dis4-\rtoe e4-\rheel e,4-\ltoe |
- %19
-}
-
-breakmusic = \notes {
- %\time4/4;
- r1
-}
-
-
-% these should be two separate scores...
-\score{
- \context Score <
- \context PianoStaff <
- \context Staff = treble {
- \praeludium_right \breakmusic \fugaII_right }
- \context Staff = bass {
- \praeludium_left \breakmusic \fugaII_left }
- >
- \context Staff = pedal {
- \praeludium_pedal \breakmusic \fugaII_pedal }
- >
-
- \paper {
- \translator {
- \VoiceContext
- \name "VoiceOne";
- verticalDirection = "1";
- }
- \translator {
- \VoiceContext
- \name "VoiceTwo";
- verticalDirection = "-1";
- }
- \translator {
- \VoiceContext
- \name "VoiceThree";
- verticalDirection = "1";
- horizontalNoteShift = "1";
- }
- \translator {
- \VoiceContext
- \name "VoiceFour";
- verticalDirection = "-1";
- horizontalNoteShift = "1";
- }
- \translator {
- \StaffContext
-
- \accepts VoiceFour;
- \accepts VoiceThree;
- \accepts VoiceTwo;
- \accepts VoiceOne;
- }
- \translator { \OrchestralScoreContext }
-castingalgorithm = \Wordwrap;
- }
-
- \midi {
- \tempo 4 =96; }
-}
+++ /dev/null
-
-\score {
- {
- \context Staff = i {
- \notes { a' b' c' d' }
- }
-
- \break
-
- \context PianoStaff <
- \context Staff = i {
- \notes { a' b' c' d' }
- }
- \context Staff = ii {
- \notes { \clef "bass"; a b c d }
- }
- >
- }
-}
test key itemv breaking
%}
\score {
- \notes
+ \notes \relative c''
{
- \key bes; c1 \key c \minor; c1
+ \key bes; c2 \key c \minor; c2
\break
\key bes \major; c1 \key d;\break c1
}
one_min_tj /= (1-t);
}
+#ifdef PARANOID
assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t))< 1e-8);
assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t))< 1e-8);
-
+#endif
return o;
}
--- /dev/null
+/*
+ box.cc -- implement Box
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "box.hh"
+#include "array.hh"
+
+void
+Box::translate (Offset o)
+{
+ for (Axis i=X_AXIS; i < NO_AXES; incr(i))
+ interval_a_[i] += o[i];
+}
+
+void
+Box::unite (Box b)
+{
+ for (Axis i=X_AXIS; i < NO_AXES; incr(i))
+ interval_a_[i].unite (b[i]);
+}
+
+/**
+ Initialize to empty.
+ */
+Box::Box()
+{
+}
+
+void
+Box::set_empty ()
+{
+ interval_a_[X_AXIS].set_empty ();
+ interval_a_[Y_AXIS].set_empty ();
+}
+
+Box::Box (Interval ix, Interval iy)
+{
+ x() = ix;
+ y() = iy;
+}
+
+Interval &
+Box::operator[] (Axis a)
+{
+ return interval_a_[a];
+}
+
+Interval
+Box::operator[] (Axis a)const
+{
+ return interval_a_[a];
+}
+++ /dev/null
-/*
- boxes.cc -- implement Box
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "box.hh"
-#include "array.hh"
-
-void
-Box::translate (Offset o)
-{
- for (Axis i=X_AXIS; i < NO_AXES; incr(i))
- interval_a_[i] += o[i];
-}
-
-void
-Box::unite (Box b)
-{
- for (Axis i=X_AXIS; i < NO_AXES; incr(i))
- interval_a_[i].unite (b[i]);
-}
-
-/**
- Initialize to empty.
- */
-Box::Box()
-{
-}
-
-void
-Box::set_empty ()
-{
- interval_a_[X_AXIS].set_empty ();
- interval_a_[Y_AXIS].set_empty ();
-}
-
-Box::Box (Interval ix, Interval iy)
-{
- x() = ix;
- y() = iy;
-}
-
-Interval &
-Box::operator[] (Axis a)
-{
- return interval_a_[a];
-}
-
-Interval
-Box::operator[] (Axis a)const
-{
- return interval_a_[a];
-}
{
if (clef_p_)
{
+ SCM vis;
if(to_boolean (clef_p_->remove_elt_property("non-default")))
{
- SCM all = scm_eval (ly_symbol2scm ("all-visible"));
- clef_p_->set_elt_property("visibility-lambda", all);
- if (octavate_p_)
- octavate_p_->set_elt_property("visibility-lambda", all);
+ vis = ly_symbol2scm ("all-visible");
}
else
- {
- SCM beg = scm_eval (ly_symbol2scm ("begin-of-line-visible"));
+ vis = ly_symbol2scm ("begin-of-line-visible");
+
+ vis = scm_eval (vis);
+
+ clef_p_->set_elt_property("visibility-lambda", vis);
+ if (octavate_p_)
+ octavate_p_->set_elt_property("visibility-lambda", vis);
- clef_p_->set_elt_property ("visibility-lambda", beg);
- if (octavate_p_)
- octavate_p_->set_elt_property ("visibility-lambda", beg);
- }
typeset_element (clef_p_);
clef_p_ =0;
#include "dimension-cache.hh"
#include "engraver.hh"
+/*
+ collect Note_column, and as soon as there are 2 or more, put them in
+ a collision object. */
class Collision_engraver : public Engraver {
Collision* col_p_;
Link_array<Note_column> note_column_l_arr_;
void
Collision::before_line_breaking ()
+{
+ do_shifts();
+}
+
+/*
+ TODO: make callback of this.
+ */
+void
+Collision::do_shifts()
{
SCM autos (automatic_shift ());
SCM hand (forced_shift ());
/** This complicated routine moves note columns around horizontally to
ensure that notes don't clash.
- This should be done better, probably.
-
+ This should be put into Scheme.
*/
SCM
Collision::automatic_shift ()
si.set_position (p + directional_element (this).get ());
}
}
+
Molecule
Dots::do_brew_molecule () const
{
{
Link_array<Paper_column> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
- line[0] = dynamic_cast<Paper_column*>(line[0]->find_broken_piece (RIGHT));
- line.top () = dynamic_cast<Paper_column*>(line.top ()->find_broken_piece (LEFT));
+ line[0] = dynamic_cast<Paper_column*> (line[0] ->find_prebroken_piece (RIGHT));
+ line.top () = dynamic_cast<Paper_column*> (line.top ()->find_prebroken_piece (LEFT));
Column_x_positions cp;
cp.cols_ = line;
+++ /dev/null
-/*
- hara-kiri-line-group-engraver.cc -- implement Hara_kiri_line_group_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "rhythmic-head.hh"
-#include "hara-kiri-vertical-group-spanner.hh"
-#include "hara-kiri-line-group-engraver.hh"
-
-
-ADD_THIS_TRANSLATOR (Hara_kiri_line_group_engraver);
-
-void
-Hara_kiri_line_group_engraver::create_line_spanner ()
-{
- staffline_p_ = new Hara_kiri_group_spanner;
-
-}
-
-void
-Hara_kiri_line_group_engraver::typeset_element(Score_element * e)
-{
- if (Rhythmic_head *h = dynamic_cast<Rhythmic_head *> (e))
- {
- dynamic_cast<Hara_kiri_group_spanner*> (staffline_p_)
- ->add_interesting_item (h);
- }
- Line_group_engraver_group::typeset_element (e);
-}
-
-/*
- bow.hh -- declare Bow
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef BOW_HH
-#define BOW_HH
-
-#include "spanner.hh"
-
-/**
- Base class for anything that looks like a slur.
- Anybody with a better name?
-
- UGH. Fixme. Should junk
-
- dy_f_drul_ , dx_f_drul_
-
- */
-class Bow : public Spanner
-{
-protected:
-};
-#error
-
-#endif // BOW_HH
#include "item.hh"
#include "parray.hh"
+/*
+ breathing sign (apostrophe within staff, not the comma above staff
+ type)
+*/
class Breathing_sign : public Item
{
public:
properties:
- nondefault -- not set because of existence of a bar?
+ non-default -- not set because of existence of a bar?
change -- is this a change clef (smaller size)?
TODO
- multistaff support (see Chlapik: equal noteheads should be on the
+ * multistaff support (see Chlapik: equal noteheads should be on the
same hpos.)
+
+ * Make interface of this, similar to align-interface.
+
+ Properties:
+
+ elements -- (see Axis_group_interface)
+
+ merge-differently-dotted -- merge black noteheads with differing dot count.
+
+ horizontal-shift -- integer that identifies ranking of note-column for horizontal shifting.
+
+ force-hshift -- amount of collision_note_width that overides automatic collision settings.
+ Read and removed from elements.
+
*/
class Collision : public Item
{
protected:
SCM automatic_shift ();
SCM forced_shift ();
-
+ void do_shifts ();
virtual void before_line_breaking ();
public:
/**
The dots to go with a notehead/rest. A separate class, since they
are a party in collision resolution.
+
+ properties:
+
+ dot-count -- number of dots.
+
+
*/
-class Dots :
- public Item
+class Dots : public Item
{
protected:
virtual Molecule do_brew_molecule () const;
As Vertical_group_spanner, but keep track of interesting items. If
we don't contain any interesting items after linebreaking, then
gracefully commit suicide. Objective: don't disgrace Lily by
- typesetting empty lines in orchestral scores. */
+ typesetting empty lines in orchestral scores.
+
+ properties:
+
+ items-worth-living -- list of interesting items. If empty in a particular system,
+ clear this line
+
+*/
class Hara_kiri_group_spanner : public Spanner
{
public:
{
Drul_array<Item*> broken_to_drul_;
- void do_break ();
- void try_visibility_lambda ();
public:
VIRTUAL_COPY_CONS(Score_element);
Item();
Direction break_status_dir () const;
- Item * find_broken_piece (Direction) const;
+ Item * find_prebroken_piece (Direction) const;
Score_element * find_broken_piece (Line_of_score*) const;
virtual Line_of_score * line_l() const;
virtual Paper_column * column_l () const;
+ virtual void handle_prebroken_dependencies ();
protected:
virtual void do_breakable_col_processing();
void copy_breakable_items();
#include "array.hh"
-/** An item which places accidentals at the start of the line
+/**
+ A group of accidentals.
- TODO: Schemify me.
+ Properties:
+
+ c0-position -- integer indicating the position of central C?
+
+ old-accidentals -- list of (pitch, accidental) pairs
+
+ new-accidentals -- list of (pitch, accidental) pairs
*/
class Key_item :public Item
{
- Array<int> pitch_arr_;
- Array<int> acc_arr_;
- Array<int> old_pitch_arr_;
- Array<int> old_acc_arr_;
+ int calculate_position(SCM pair) const;
public:
VIRTUAL_COPY_CONS(Score_element);
void add (int pitch, int acc);
void add_old (int pitch, int acc);
- int calculate_position(int p, int a) const;
-
protected:
virtual Molecule do_brew_molecule() const;
};
/**
Accidentals which can be different for each octave.
-
- TODO
-
- Make an item for each accidental separately, and make a
- Accidental_column to group them.
-
+ TODO: schemify me!
*/
-
class Local_key_item : public Item
{
Array<Local_key_cautionary_tuple> accidental_arr_;
+++ /dev/null
-/*
- mark-engraver.hh -- declare Mark_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-
-#ifndef MARK_ENGRAVER_HH
-#define MARK_ENGRAVER_HH
-
-#error
-
-
-dendif // MARK_ENGRAVER_HH
* help lines
+ Properties
+
+ style -- symbol that sets note head style
+
*/
class Note_head : public Rhythmic_head
#include "rhythmic-head.hh"
+/**
+ A pause.
+
+ Properties
+
+ style -- string specifying glyph style
+ */
class Rest : public Rhythmic_head
{
protected:
#include "item.hh"
+/*
+ Properties
+
+ duration-log -- 2-log of the notehead duration
+
+ dot -- reference to Dots object.
+
+*/
class Rhythmic_head : public Item
{
public:
since these usually are in a different X_group
It's 1:30 am. Naming suggestions appreciated.
+
+ Properties:
+
+
+ elements -- list of items.
+
+ no-spacing-rods -- read from elements: boolean that makes Single_malt_grouping_item ignore
+ this item
+
*/
class Single_malt_grouping_item : public Item
{
void add_item (Item*);
};
-
#endif /* SINGLE_MALT_GROUPING_ITEM_HH */
+++ /dev/null
-/*
- super-element.hh -- declare Super_element
-
- source file of the LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef Super_element_HH
-#define Super_element_HH
-
-#error
-#include "score-element.hh"
-
-#endif // Super_element_HH
/**
Item copy ctor. Copy nothing: everything should be a elt property
- or a special purpose poitner (such as broken_to_drul_[]) */
+ or a special purpose pointer (such as broken_to_drul_[]) */
Item::Item (Item const &s)
: Score_element (s)
{
return false;
Item * i =dynamic_cast<Item*> (parent_l (X_AXIS));
- return (i) ? i->breakable_b () : to_boolean (get_elt_property( "breakable"));
+ return (i) ? i->breakable_b () : to_boolean (get_elt_property ("breakable"));
}
Line_of_score *
}
while (flip(&i) != LEFT);
broken_to_drul_= new_copies;
-
- do
- {
- broken_to_drul_[i]->handle_prebroken_dependencies();
- broken_to_drul_[i]->try_visibility_lambda();
- }
- while (flip(&i) != LEFT);
}
-void
-Item::try_visibility_lambda ()
-{
- SCM vis = remove_elt_property ("visibility-lambda");
- if (gh_procedure_p (vis))
- {
- SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
- SCM result = gh_apply (vis, args);
- bool trans = gh_scm2bool (gh_car (result));
- bool empty = gh_scm2bool (gh_cdr (result));
-
- if (empty)
- {
- set_extent_callback (0, X_AXIS);
- set_extent_callback (0, Y_AXIS);
- }
- if (trans)
- set_elt_property ("transparent", SCM_BOOL_T);
- }
-}
bool
Item::broken_b () const
}
void
-Item::do_break ()
+Item::do_breakable_col_processing()
{
if (broken_b ())
return;
if (breakable_b ())
- {
- copy_breakable_items();
- handle_prebroken_dependencies();
-
- /*
- Otherwise the broken items won't be pre_process()'ed.
- */
-
- if (broken_to_drul_[LEFT])
- {
- add_dependency (broken_to_drul_[LEFT]);
- add_dependency (broken_to_drul_[RIGHT]);
- }
- }
- try_visibility_lambda (); // ugh.
-}
-
-void
-Item::do_breakable_col_processing()
-{
- do_break ();
+ copy_breakable_items();
}
Score_element*
Direction d = LEFT;
do {
- Score_element *s = find_broken_piece (d);
+ Score_element *s = broken_to_drul_[d];
if (s && s->line_l () == l)
return s;
}
return 0;
}
+
Item*
-Item::find_broken_piece (Direction d) const
+Item::find_prebroken_piece (Direction d) const
{
Item * me = (Item *) (this);
if (!d)
return me;
- else if (breakable_b ())
- {
- me->do_break ();
- return dynamic_cast<Item*> (broken_to_drul_[d]);
- }
- else
- return 0;
+ return dynamic_cast<Item*> (broken_to_drul_[d]);
}
Paper_column *
return CENTER;
}
+void
+Item::handle_prebroken_dependencies ()
+{
+ if (original_l_)
+ {
+ element_property_alist_
+ = handle_broken_smobs (original_l_->element_property_alist_,
+ gh_int2scm (break_status_dir ()));
+ }
+
+ /*
+ Can't do this earlier, because try_visibility_lambda () might set
+ the elt property transparent, which would then be copied.
+ */
+ SCM vis = remove_elt_property ("visibility-lambda");
+ if (gh_procedure_p (vis))
+ {
+ SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
+ SCM result = gh_apply (vis, args);
+ bool trans = gh_scm2bool (gh_car (result));
+ bool empty = gh_scm2bool (gh_cdr (result));
+ if (empty)
+ {
+ set_extent_callback (0, X_AXIS);
+ set_extent_callback (0, Y_AXIS);
+ }
+ if (trans)
+ set_elt_property ("transparent", SCM_BOOL_T);
+ }
+}
keyplacement by Mats Bengtsson
*/
+#include "group-interface.hh"
#include "key-item.hh"
-#include "key.hh"
-#include "debug.hh"
#include "molecule.hh"
#include "paper-def.hh"
#include "lookup.hh"
-#include "musical-pitch.hh"
#include "staff-symbol-referencer.hh"
const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
{
set_elt_property ("breakable", SCM_BOOL_T);
set_elt_property ("c0-position", gh_int2scm (0));
+
+ set_elt_property ("old-accidentals", SCM_EOL);
+ set_elt_property ("new-accidentals", SCM_EOL);
}
void
Key_item::add (int p, int a)
{
- pitch_arr_.push (p);
- acc_arr_.push (a);
+ SCM pair = gh_cons (gh_int2scm (p),gh_int2scm (a));
+ Group_interface (this, "new-accidentals").add_thing (pair);
}
void
Key_item::add_old (int p, int a)
{
- old_pitch_arr_.push (p);
- old_acc_arr_.push (a);
+ SCM pair = gh_cons (gh_int2scm (p),gh_int2scm (a));
+ Group_interface (this, "old-accidentals").add_thing (pair);
}
int
-Key_item::calculate_position(int p, int a) const
+Key_item::calculate_position(SCM pair) const
{
+ int p = gh_scm2int (gh_car (pair));
+ int a = gh_scm2int (gh_cdr (pair));
+
if (to_boolean (get_elt_property ("multi-octave")))
{
return p + gh_scm2int (get_elt_property ("c0-position"));
{
p -= 7; /* Typeset below c_position */
}
- /* Provide for the four cases in which there's a glitch */
- /* it's a hack, but probably not worth */
- /* the effort of finding a nicer solution. dl. */
+ /* Provide for the four cases in which there's a glitch
+ it's a hack, but probably not worth
+ the effort of finding a nicer solution.
+ --dl. */
if (c0==2 && a>0 && p==3)
p -= 7;
if (c0==-3 && a>0 && p==-1)
/*
TODO
- space the `natural' signs wider
- - dehair this
+
+
+
*/
+
Molecule
Key_item::do_brew_molecule() const
{
Staff_symbol_referencer_interface si (this);
Real inter = si.staff_space ()/2.0;
- int j;
- if ((break_status_dir () == LEFT || break_status_dir () == CENTER)
- || old_pitch_arr_.size ())
- {
- for (int i =0; i < old_pitch_arr_.size(); i++)
- {
- for (j =0; (j < pitch_arr_.size())
- && (old_pitch_arr_[i] != pitch_arr_[j]); j++)
- ;
-
- if (j == pitch_arr_.size()
- || (old_pitch_arr_[i] == pitch_arr_[j]
- && old_acc_arr_[i] != acc_arr_[j]))
- {
- Molecule m =lookup_l ()->afm_find ("accidentals-0");
-
- m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS);
- mol.add_at_edge (X_AXIS, RIGHT, m,0);
- }
- }
+ SCM newas = get_elt_property ("new-accidentals");
+ /*
+ SCM lists are stacks, so we work from right to left, ending with
+ the cancellation signature.
+ */
+ for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s))
+ {
+ int a = gh_scm2int (gh_cdar (s));
+ Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (a));
+ m.translate_axis (calculate_position(gh_car (s)) * inter, Y_AXIS);
+ mol.add_at_edge (X_AXIS, LEFT, m, 0);
+ }
+
+ if (break_status_dir () != RIGHT)
+ {
+ SCM old = get_elt_property ("old-accidentals");
/*
Add half a space between cancellation and key sig.
Interval x(0, inter);
Interval y(0,0);
- mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->blank (Box(x,y)),0);
+ mol.add_at_edge (X_AXIS, LEFT, lookup_l()->blank (Box(x,y)),0);
+
+ for (; gh_pair_p (old); old = gh_cdr (old))
+ {
+ SCM found = SCM_EOL;
+
+ /*
+ find correspondences in pitches
+ */
+ for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s))
+ if (gh_caar(s) == gh_caar (old))
+ found = gh_car (s);
+
+ if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old))
+ {
+ Molecule m =lookup_l ()->afm_find ("accidentals-0");
+
+ m.translate_axis (calculate_position(gh_car(old)) * inter, Y_AXIS);
+ mol.add_at_edge (X_AXIS, LEFT, m,0);
+ }
+ }
+
+
}
- for (int i =0; i < pitch_arr_.size(); i++)
- {
- Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i]));
- m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS);
- mol.add_at_edge (X_AXIS, RIGHT, m, 0);
- }
return mol;
}
{
for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
unsmob_element (gh_car (s))->do_breakable_col_processing ();
+ for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ unsmob_element (gh_car (s))->handle_prebroken_dependencies ();
fixup_refpoints (get_elt_property ("all-elements"));
Item * l = get_bound (LEFT)->column_l ();
Item * r = get_bound (RIGHT)->column_l ();
- Item * lb = l->find_broken_piece (RIGHT);
- Item * rb = r->find_broken_piece (LEFT);
+ Item * lb = l->find_prebroken_piece (RIGHT);
+ Item * rb = r->find_prebroken_piece (LEFT);
Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}};
for (int i=0; i < 4; i++)
#include "dimension-cache.hh"
#include "side-position-interface.hh"
#include "item.hh"
+
/*
TODO:
}
-
+/*
+ ugh.
+ */
Molecule
Score_element::do_brew_molecule() const
{
Direction d = to_dir (criterion);
if (i && i->break_status_dir () != d)
{
- Item *br = i->find_broken_piece (d);
+ Item *br = i->find_prebroken_piece (d);
return (br) ? br->self_scm_ : SCM_UNDEFINED;
}
}
else
{
-
Line_of_score * line = dynamic_cast<Line_of_score*> (unsmob_element ( criterion));
- Line_of_score * dep_line = sc->line_l ();
+ Line_of_score * dep_line = sc->line_l ();
if (dep_line != line)
{
- Score_element * br = sc->find_broken_piece (line);
+ Score_element * br = sc->find_broken_piece (line);
return (br) ? br->self_scm_ : SCM_UNDEFINED;
}
if (!dep_line)
return handle_broken_smobs (cdr, criterion);
- We don't want to rely on the compiler to do this. */
+ We don't want to rely on the compiler to do this. Without
+ tail-recursion, this easily crashes with a stack overflow. */
src = cdr;
goto again;
}
/*
This element is `invalid'; it has been removed from all dependencies, so
let's junk the element itself.
-
*/
element_property_alist_ = SCM_EOL;
set_extent_callback (0, Y_AXIS);
set_extent_callback (0, X_AXIS);
}
-
-
}
-
-/*
- TODO: cleanify.
- */
void
Score_element::handle_prebroken_dependencies()
{
- if (Item*i =dynamic_cast<Item*> (this))
- {
- if (original_l_)
- {
- element_property_alist_
- = handle_broken_smobs (original_l_->element_property_alist_,
- gh_int2scm (i->break_status_dir ()));
- }
- }
}
+
bool
Score_element::linked_b() const
{
Direction my_dir = i->break_status_dir () ;
if (my_dir!= parenti->break_status_dir())
{
- Item *newparent = parenti->find_broken_piece (my_dir);
+ Item *newparent = parenti->find_prebroken_piece (my_dir);
set_parent (newparent, ax);
}
}
SMOB funcs
****************************************************/
-
#include "ly-smobs.icc"
IMPLEMENT_UNSMOB(Score_element, element);
continue;
Single_malt_grouping_item *lb
- = dynamic_cast<Single_malt_grouping_item*>(l->find_broken_piece (RIGHT));
+ = dynamic_cast<Single_malt_grouping_item*>(l->find_prebroken_piece (RIGHT));
Single_malt_grouping_item *rb
- = dynamic_cast<Single_malt_grouping_item*>(r->find_broken_piece (LEFT));
+ = dynamic_cast<Single_malt_grouping_item*>(r->find_prebroken_piece (LEFT));
a.push (make_rod(l, r));
if (lb)
SCM elt = gh_car (s);
if (!SMOB_IS_TYPE_B(Score_element, elt))
continue;
-
-
Item *il = dynamic_cast<Item*> (SMOB_TO_TYPE (Score_element, elt));
if (pc != il->column_l ())
{
Item * l = cols[i];
Item * r = cols[i+1];
- Item * lb = l->find_broken_piece (RIGHT);
- Item * rb = r->find_broken_piece (LEFT);
+ Item * lb = l->find_prebroken_piece (RIGHT);
+ Item * rb = r->find_prebroken_piece (LEFT);
Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}};
Direction d = LEFT;
do
{
- Item* bound = left->find_broken_piece (d);
+ Item* bound = left->find_prebroken_piece (d);
if (bound->line_l ())
{
Spanner * span_p = dynamic_cast<Spanner*>( clone ());
{
Item *&pc_l = bounds[d] ;
if (!pc_l->line_l())
- pc_l = pc_l->find_broken_piece(- d);
+ pc_l = pc_l->find_prebroken_piece(- d);
assert (pc_l);
}
do
{
if (!spanned_drul_[i]->line_l())
- set_bound(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
+ set_bound(i,spanned_drul_[i]->find_prebroken_piece((Direction) -i));
}
while (flip(&i) != LEFT);
}
arithmetic_basicspace = 2.0;
+
+
#'Stem_tremolo::beam-width = 1.5 * \quartwidth ;
#'Left_edge_item::visibility-lambda = #begin-of-line-visible
+%
+% UGH; junk these!
+%
+
#'Key_item::visibility-lambda = #begin-of-line-visible
#'Breathing_sign::visibility-lambda = #begin-of-line-invisible
Begin3
Title: LilyPond
-Version: 1.3.50
-Entered-date: 12MAY00
+Version: 1.3.51
+Entered-date: 16MAY00
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.50.tar.gz
+ 1000k lilypond-1.3.51.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.50.tar.gz
+ 1000k lilypond-1.3.51.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.50
+Version: 1.3.51
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.50.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.51.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
((none Instrument_name) . (extra-space 1.0))
((Instrument_name Left_edge_item) . (extra-space 1.0))
((Left_edge_item Clef_item) . (extra-space 1.0))
+ ((Left_edge_item Key_item) . (extra-space 0.0))
((none Left_edge_item) . (extra-space 0.0))
((Left_edge_item Staff_bar) . (extra-space 0.0))
; ((none Left_edge_item) . (extra-space -15.0))