lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

clean relative pitches


From: Han-Wen Nienhuys
Subject: clean relative pitches
Date: Sun, 07 Jan 2007 14:43:03 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20061219)

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 - address@hidden - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]