+2003-04-16 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/new-chord-name-engraver.cc (process_music): use octavation
+ (a number) instead of original-pitch to store inversions. This
+ fixes a problem with transposed chords with inversions.
+
2003-04-14 Jan Nieuwenhuizen <janneke@gnu.org>
* stepmake/aclocal.m4: Include compile fix for broken flex, as
dnl aclocal.m4 -*-shell-script-*-
+dnl WARNING WARNING WARNING
+dnl do not edit! this is aclocal.m4, generated from /home/hanwen/usr/src/lilypond/stepmake/aclocal.m4
+dnl aclocal.m4 -*-shell-script-*-
dnl StepMake subroutines for configure.in
void
Event::transpose (Pitch delta)
{
+ /*
+ TODO: should change music representation such that
+ _all_ pitch values are transposed automatically.
+ */
+
Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
if (!p)
return ;
for (int i =0 ; i < notes_.size (); i++)
{
Music *n = notes_[i];
- SCM p = n->get_mus_property ("pitch");;
+ SCM p = n->get_mus_property ("pitch");
+ if (!unsmob_pitch (p))
+ continue;
+
if (n->get_mus_property ("inversion") == SCM_BOOL_T)
{
inversion_event = n;
if (inversion_event)
{
- SCM op = inversion_event->get_mus_property ("original-pitch");
- if (unsmob_pitch (op))
- pitches= gh_cons (op, pitches);
+ SCM oct = inversion_event->get_mus_property ("octavation");
+ if (gh_number_p (oct))
+ {
+ Pitch *p = unsmob_pitch (inversion_event->get_mus_property ("pitch"));
+ int octavation = gh_scm2int (oct);
+ Pitch orig = p->transposed (Pitch (-octavation, 0,0));
+
+ pitches= gh_cons (orig.smobbed_copy (), pitches);
+ }
else
programming_error ("Inversion does not have original pitch.");
}
$$->set_mus_property ("element", p->self_scm ());
scm_gc_unprotect_object (p->self_scm ());
+
$$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ());
}
Pitch
Relative_octave_music::to_relative_octave (Pitch)
{
+ /*
+ ugh: last-pitch should be junked.
+
+ Change this for lilypond 2.0. When you do,
+ then B should start where A left off.
+
+ \relative { A \relative { ...} B }
+
+ */
+
return * unsmob_pitch (get_mus_property ("last-pitch"));
}
(if inv-note
(begin
(ly:set-mus-property! inv-note 'inversion #t)
- (ly:set-mus-property! inv-note 'original-pitch original-inv-pitch)
+ (ly:set-mus-property! inv-note 'octavation
+ (- (ly:pitch-octave inversion)
+ (ly:pitch-octave original-inv-pitch))
+ )
(set! nots (cons inv-note nots))))
(make-event-chord nots)
(music-property-description 'name symbol? "Name of this music object")
(music-property-description 'numerator integer? "numerator of a time signature")
(music-property-description 'once boolean? "Apply this operation only during one time step?")
-(music-property-description 'original-pitch ly:pitch?
- "Pitch before inversion. Needed to reconstruct chord name.")
+(music-property-description 'octavation integer?
+ "This pitch was octavated by how many octaves?
+For chord inversions, this is negative.")
(music-property-description 'origin ly:input-location? "where was this piece of music defined?")
(music-property-description 'penalty number? "Penalty for break hint.")
(music-property-description 'pitch ly:pitch? "the pitch of this note")