lilypond-devel
[Top][All Lists]
Advanced

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

Re: Chromatic transposition -- a very small starting step


From: Neil Puttock
Subject: Re: Chromatic transposition -- a very small starting step
Date: Fri, 9 Jul 2010 00:07:03 +0100

On 8 July 2010 23:20, Joseph Wakeling <address@hidden> wrote:

> Can you explain more precisely ... ?  This seems like something I should
> understand very well in order to provide an effective solution.

Context properties (using \set & \unset) are tied to engravers: they
provide information relevant to the generation of graphical objects.

Since transposition occurs at the music interpretation stage, it has
no direct connection with engravers: the pitch of a note is fixed
before a notehead is created.  Consider the following minimal snippet:

{ c' }

This generates (simplified) a NoteEvent, with its pitch and duration
as event properties,

(make-music
  'NoteEvent
  'duration
  ly:make-duration 2 0 1 1)
  'pitch
  (ly:make-pitch 0 0 0)

which the Note_heads_engraver hears.  It passes this information on to
the NoteHead grob it creates from the event, so the head's correct
position and duration-log can be determined once it's ready for
printing.

If we transpose the snippet,

\transpose c d { c' }

the pitch is changed before it reaches the engraver (in fact, it
happens just after the parsing stage with the creation of a
TransposedMusic music object):

(make-music
 'NoteEvent
 'duration
 (ly:make-duration 2 0 1 1)
 'pitch
 (ly:make-pitch 0 1 0)

You can see an example of a music property relevant to transposition:
untransposable.

\transpose c d { c'2 \withMusicProperty #'untransposable ##t c' }

-> the second c' remains untransposed.

Take a look at lily/music.cc to see where the transposition takes place.

Cheers,
Neil



reply via email to

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