lilypond-user
[Top][All Lists]
Advanced

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

Re: New argument types (Was: Constructive Criticism and a Question)


From: Mats Bengtsson
Subject: Re: New argument types (Was: Constructive Criticism and a Question)
Date: Mon, 08 Jan 2007 09:30:53 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20061206)



address@hidden wrote:
Increasing the number of different argument types for music functions
would almost certainly be extremely useful for users, who, judging from
this mailing list, seem to have an unlimited imagination when it comes to
wanting to be able to extend LP syntax.

I doubt that the number of argument types is any major problem. The first big hurdle is the Scheme language itself and even if you know Scheme, the next big hurdle
is to figure out the connection between LilyPond and Scheme.

Since recognizing a duration expression is purely a notational problem
(in the sense that a notation has to be found that will be unambiguous for
the parser), it might be worth asking for people's ideas.  The things I
can think of offhand are the following --

   \foo c (4.)     % no good -- confusion with slurs
   \foo c \nul 4.  % \nul would be a sort of syntactic "breath mark"
   \foo c \ 4.     % \ -- same idea as \nul (short, but maybe risky?)
   \foo c \\ 4.    % \\ -- same as \nul
   \foo c =4.      % = prefixed to any expression: "this is separate item"
Sorry to sound so negative, but I definitely don't like the idea of reusing
symbols like \ or \\ or = to have several different meanings in different
syntactical constructs. For example, I think this is one of the big problems
with the C++ programming language.  If we should add a new syntactical
element for durations, then we should look for some symbol on the keyboard
that isn't already used in the current syntax.

If you currently want a duration as the input to a music function and don't like to use
(ly:make-duration 2 0) as the argument value, then you can simply use a
note value (even a spacing note like s2) as the argument and copy the duration
of that one within the music function.

  /Mats





reply via email to

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