lilypond-devel
[Top][All Lists]
Advanced

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

Re: What is void music?


From: Dan Eble
Subject: Re: What is void music?
Date: Tue, 22 Aug 2017 18:56:14 -0400

On Aug 22, 2017, at 09:44, David Kastrup <address@hidden> wrote:
> 
>> I stumbled at this when I tried to define a predicate for void music,
>> used (B) as an example, and found that it didn’t catch ##{#}.  I’m not
>> sure what to do.
> 
> What is it that you are trying to predicate?  The void flag is typically
> set on music that is the result of an error.

I am using it in a conditional function to support various subsets of an SATB 
staff in one include file.

        \ifThenElse \aNotes <<
                \ifThenElse \bNotes <<
                        … \partcombine \aNotes \bNotes ...
                >> <<
                        … \aNotes …
                >>
        >> <<
                … \bNotes …
        >>

"Void music" sounded like a natural way to represent a lack of music.  An 
alternative is to leave the variable undefined, but I couldn’t figure out a way 
to do that without resorting to Scheme, something like this:

        #(if (defined? aNotes) #{ <<
                …
        >> #} #{ <<
                …
        >> #}

That is much more difficult for me to read.

>> Are these different concepts that have been given the same name, or
>> are they different valid representations of void music? ... or is the
>> difference an error?
> 
> ly-syntax-constructors.scm is internal.  void-music is not
> user-callable.

OK, but according to the Extending guide, section 2.1, "an empty LilyPond block 
corresponds to a void music expression,” so there is a user-accessible way to 
get void music.

        aNotes = ##{#}

Thanks for pointing out the age of this code and the unsuccessful attempt to 
clean it up.  I’m not keen to try cleaning it up myself now.  I’ll work with 
what I have, which in spite of not making complete sense internally, looks fine 
on the surface.

Regards,
-- 
Dan




reply via email to

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