|
From: | Han-Wen Nienhuys |
Subject: | Re: Music functions and # |
Date: | Wed, 20 Jul 2005 19:29:49 +0200 |
User-agent: | Mozilla Thunderbird 1.0.2-6 (X11/20050513) |
Erik Sandberg wrote:
it's possible, but you have to have extra error checking to catch things like \transpose { f } \lyrics { bar } { ..victic-music.. }What if we just define transpose using something like transpose = #(def-music-function .. (ly:pitch? ly:pitch? ly:music?) .. ) ? I think this would catch the above with something like wrong type for argument 1. Expecting pitch. which IMHO even is better than the current Unexpected '{'
yes, but a ly:pitch? object is a C++ Pitch object, which is different from Music. So you would define transpose as
(ly:music? ly:music? ly:music?)and check that the first 2 arguments are event-chords with a single noteevent inside. Right now, you cannot define it as
(pitch, pitch, music) since lily interprets \transpose c d {..stuff..} as \transpose c4 d4 {..stuff..} where c4 and d4 are in fact EventChords. -- Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen
[Prev in Thread] | Current Thread | [Next in Thread] |