lilypond-user
[Top][All Lists]
Advanced

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

Re: simple scheme function #{ $note #}


From: David Kastrup
Subject: Re: simple scheme function #{ $note #}
Date: Fri, 11 May 2018 23:17:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Aaron Hill <address@hidden> writes:

> On 2018-05-11 09:34, David Kastrup wrote:
>> There is no "incomplete music expression".  #{ ... #} is used for
>> converting a whole slew of different expression types from LilyPond
>> syntax to Scheme: pitches, durations, markups, music, numbers with
>> dimension and other stuff.  A pitch is not an "incomplete music
>> expression".  It's a type of its own.
>
> The error message reads pretty clearly, though.  The result of a music
> function cannot be a single NOTENAME_PITCH.

The result of a music function cannot be a pitch, period.  It has to be
a music expression.  A pitch is not a music expression.

> Of course, if returning a single pitch *is* valid for a music
> function,

You are obsessing about "single".  There is no such thing as a "single"
pitch.  A pitch is a pitch.  There is no "double" pitch.  A pitch is not
a music expression.  It may be a property of a note (which is a music
expression).  #{ c' #} is not a music expression.  It is a shorthand for
a pitch.  #{ c' c' #} is not a pitch.  It corresponds to the sequential
music expression you get when writing { c' c' } .  #{ ... #} is a
general convertor of LilyPond expressions into various kinds of Scheme
expressions.

LilyPond expressions tend to be rather ambiguous: a pitch looks like a
note event.  So #{ #} has to make a few choices.  When it can interpret
its content as a pitch, it does.  Otherwise if it can be seen as note
event (or other single music expression), it does that.  Otherwise if it
could be the body of a sequential music expression, it makes sequential
music.  It may do post events, too.  Or markups.  Or strings.  Or
numbers.  Whatever it does, the type of the resulting Scheme expression
does not magically change.  Pitches don't convert themselves magically
into music expressions.

> then either the error message is misleading or there is a underlying
> bug that needs to be addressed.

The error message is "error: music function cannot return c'" which is
exactly correct.  A music function cannot return a pitch.  It has to
return a music expression.

-- 
David Kastrup



reply via email to

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