So there is a distinction between parser keywords and music functions?

On Sun, Dec 14, 2008 at 12:43 PM, Neil Puttock <n.putt...@gmail.com> wrote:

> Hi John,
>
> 2008/12/14 John Mangual <john.mang...@gmail.com>:
> > how would i go about looking up the scheme source code for a specific
> > function like "transpose" or "tuple" or "key"
>
> It depends on whether the function is a parser keyword or music
> function; if it's the latter (you can check this by looking at
> appendix B.14, Identifiers) then you're most likely to find it in
> ly/music-functions-init.ly.
>
> In the case of keywords, you'll have to follow the trail from the
> parser.  For example, here's the parser entry for \transpose:
>
>        | TRANSPOSE pitch_also_in_chords pitch_also_in_chords music {
>                Pitch from = *unsmob_pitch ($2);
>                Pitch to = *unsmob_pitch ($3);
>                SCM pitch = pitch_interval (from, to).smobbed_copy ();
>                $$ = MAKE_SYNTAX ("transpose-music", @$, pitch, $4);
>        }
>
> The MAKE_SYNTAX macro calls the Scheme function transpose-music, which
> you'll find in scm/ly-syntax-constructors.scm:
>
> (define-ly-syntax-simple (transpose-music pitch music)
>  (make-music 'TransposedMusic
>              'element (ly:music-transpose music pitch)))
>
> Regards,
> Neil
>
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to