Erik Sandberg escreveu: > (I'm working on a system for 'music macros', which should make it possible to > delay the dereferencing of variables, this will mainly be useful to clean up > \relative)
I yesterday got some new ideas in that direction: reorganize Pitch and Scale, to introduce a new class Scale_pitch - Scale has a list of Scale_pitches with their names (Scale is a recent addition, that's not been used much, but it's theoretically clean concept; see scale.cc) - Scale_pitch is like the current Pitch, without octave: a step (integer) + alteration (rational). - The parser transforms names into Scale_pitches, by asking the current Scale object to retrieve it from the name <-> Scale_pitch mapping. - (name + quotes) in a note is translated to scale-pitch + delta-octave property - Transposition for relative changes * Scale_pitch, * octave of start-pitch but leaves delta-octave alone. This allows transposition and relative to commute. - This means that music functions must be prepared to deal with 2 types of pitch : relative (scale + delta-octave) and absolute (the current Pitch type) - Pitch is computed by from Scale_pitch + delta-octave - Absolute pitches (eg. transposition) are stored as Pitch object. - (Optional): once relative pitches are stored in a music object, the music object should get a 'previous pointer so any absolute pitch can be computed directly, eg. using a callback. Then note->get_property ("pitch") triggers the possibly cascading relative-to-absolute computation. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user