lilypond-user
[Top][All Lists]
Advanced

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

Re: A music function that drops music.


From: David Kastrup
Subject: Re: A music function that drops music.
Date: Sat, 07 Dec 2013 11:04:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Richard Shann <address@hidden> writes:

> I have created this function to drop a staff from a \score { } block:
>
> DropMusic =
> #(define-music-function
>      (parser location arg1)
>      (ly:music?)
>      #{
>      #}
>   )
>
> This will be useful in Denemo to allow the user to create a staff that
> is not typeset, but needs to be present for other purposes (such as
> creating the BeamExceptions that David mentioned).
>
> I imagine this is a function without a purpose for most users but I
> mention it here for three reasons
>       * Perhaps it already exists under a different name, or is not the
>         best syntax, or doesn't do exactly what I think it does.

\void

There are some slight differences in behavior since \void has a
predicate of type scheme? rather than ly:music?, and because it does not
return music but *unspecified*, but in most use cases they should do
pretty much the same.

>       * and because I am inordinately proud of having managed to create
>         it. A tribute, in fact, to the quality of LilyPond's
>         documentation. A very fine line to draw between saying too much
>         (and losing people's attention) and saying too little.

Well, it depends on whether you _synthesized_ your example from
instructions that were reasonably comprehensible, or whether you pruned
an existing example down using guesswork.

The second approach would likely have been faster for this problem and
would say little about the quality of the documentation but rather about
your guessing skills and the amenability of LilyPond to guesswork (which
I consider important).

Which is actually rather common: one of the most frequent phenomena of
people asking for help because their Emacs broke is "I don't know what
this code in my .emacs file does, I just copied it from somewhere".

The first approach would be slower, but of course says more about the
quality of documentation and your progress on the road to mastering the
more powerful depths of LilyPond.

-- 
David Kastrup



reply via email to

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