As an exercise in learning to write lilypond scheme extensions, I've been
trying to write a music-function that, given an EventChord or
SequentialMusic, will return the passage in octaves, so c would return <c
c,>.  I've run into a problem, though.

When I run the following:

\version "2.10.20"
\relative c' {
 \displayMusic <c' c,>
}
\relative c'' {
 \displayMusic <c c,>
}

While the music it generates is the same, the scheme it generates is
different.  In the first case, the scheme pitches generated are:
(ly:make-pitch 0 0 0)
(ly:make-pitch -2 0 0)

But in the second case, it returns:
(ly:make-pitch -1 0 0)
(ly:make-pitch -2 0 0)

But the music it generates is the same.  This seems to conflict with the
docs for ly:make-pitch as I understand it: "octave is specified by an
integer, zero for the octave containing middle C."  It seems to somehow
relate to the current relative pitch, not necessarily middle c.  Unless I
don't understand how the doc is defining 'middle c'?

The problem I've hit is that, whenever I try to add the lower octave to the
EventChord, I don't know whether to subtract the octave of the pitch passed
in by 1 or 2 (or something else).  I've also tried using ly:pitch-transpose,
but I wind up with the same result.

Is there some other way that I can find the absolute pitch of the note?  Or
some other approach I can use?
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to