"Trevor Daniels" <[email protected]> writes:

> David Kastrup wrote Thursday, July 26, 2012 10:01 AM
>
>
>> Keith OHara <[email protected]> writes:
>> 
>>> If I make a function 
>>>   \dichrom3D { c4 d e f } 3.7
>>> that engraves a passage so that the notes appear to float 3.7 staff-spaces
>>> above the paper when viewed with red/cyan 3D glasses, 
>>>
>>> then if I use it on an isolated note \dichrom3D e 2.9
>>> I get a dotted-half-note e floating 9.0 staff-spaces above the page.
>
> I'm not sure I've followed all this discussion, but if it is or
> becomes possible to write a music function like \dichrom3D
> which /silently/ behaves differently if one of its real arguments
> happens to begin with a sequence that can be interpreted as
> a duration, then we've definitely gone astray.
>
> Please tell me I've misunderstood something.

hup =
#(define-music-function (parser location m s) (ly:music? number?)
  #{ \set Staff.middleCOffset = #s \applyContext #ly:set-middle-C!
     #m \unset Staff.middleCOffset #})

\hup { c4 d e f } 4

already works.

\hup e4 2 is supposed to work as well, but apparently does not at the
moment.  Probably something that needs fixing.

Using music functions in the context of layout definitions will require
in the worst case using

\notemode { ... }

in which case interpretation becomes unproblematic.

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to