lilypond-user
[Top][All Lists]
Advanced

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

Re: Possible feature request for 'q' shorthand or tie syntax


From: David Kastrup
Subject: Re: Possible feature request for 'q' shorthand or tie syntax
Date: Fri, 21 Sep 2012 01:32:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Jim Long <address@hidden> writes:

> On Thu, Sep 20, 2012 at 09:55:35PM +0200, David Kastrup wrote:
>> 
>> > But if stand-alone durations (like a '4' standing by itself)
>> > could inherit the previous pitch (somewhat symmetric to how a
>> > stand-alone pitch inherits the previous duration), one could
>> > write:
>> >
>> > c1 ~ | 4 cis dis cis ~ | 1
>> 
>> So is c4 c c 2 the same as c4 c4 c2 or as c4 c4 c4 c2 ?
>
> Hmmm...  I just ran a test, and I was not previously aware that
> 'c 2' was valid.  I have been under the incorrect assumption that
> whitespace was not allowed between a pitch/chord and its
> duration.  In other words, I thought once whitespace has been
> found, the previous token was complete.  Not currently the case,
> apparently.  As I said earlier, I'm enjoying the learning
> process.
>
> Here's the rule I'm envisioning.  I'm going to change the horizontal
> string to vertical for illustration:
>
> c4    pitch specified, duration specified
> c     pitch specified, duration (4) implied from previous duration
> c     pitch specified, duration (4) implied from previous duration
> 2     duration specified, pitch (c) implied from previous pitch(es)
>
> c4 c c 2 would be the same as c4 c4 c4 c2.

And c4 c4 c4 c2 the same as c4 c 4 c 4 c 2, namely as c4 c4 c4 c4 c4 c4 c2?
You say "I have been under incorrect assumption that whitespace was not
allowed ...".  But that means you either have to correct your
assumption, or you have make a new proposal including changes that make
your assumptions true.  Making spaces carry meaning between pitch and
duration is a rather large change.

> A pitch or chord with an explicit duration would have to have no
> whitespace in between, as c2 or <f a c>1.

Pitches can also be put into a variable, like
tonic=f

{ \tonic 2 }

So you want to force writing \tonic2 as well, I assume?  We can also
place them into variables.  Few minutes ago, someone else proposed a
function

av = #(define-music-function (parser location x) (ly:pitch?)
   #{
     $x 8 ~ $x 4
   #})

Now you can't write $x8 here since then Scheme would look for an
identifier x8.  You need the space.  Should then there be a difference
between writing one and writing two spaces?

> Thus, c2 c 2 would be
> three notes, all half notes, all on pitch c, and <f a c> 1 would
> be two chords, one with an implied duration not determinable from
> this example, and one with a duration of a whole note.
>
> Just a show of hands if anyone is reading this far, is the syntax
>
> 'c 4  c    4     c      4  c4'
>
> widely used (whitespace exaggerated)?

See the above music function.  It is wide enough use that the latest
posting in an _independent_ news thread actually uses exactly that.

> I'm not a frescobaldi user
> nor any of the other lilypond-aware tools, but do they generate
> lily-code that puts whitespace between pitches/chords and
> durations?

That depends on what the user enters.

> Just wondering whether I'm an eccentric to always write c4 and <bes
> d>2 and never f 1 or <c e g> 16.

No, you are not eccentric.  Most people do this by convention, but not
every convention makes sense changing into law.

>> q was _explicitly_ changed to _only_ repeat chords _after_ extensive
>> discussion.  The first approach was repetition of _both_ notes and
>> chords, and people were not happy with it.
>
> I respect their happiness and propose no changes to q.  Absent my
> proposed concept of an implied pitch, if a 'p' shortcut can be
> implemented easily, I would find it to be a welcome and useful
> addition.

I am not convinced it will be worth the trouble regarding manual note
entry as note names are not hard or long to type.

The one thing that is calling for improvement is repeated use of the
same pitch in music functions that might see use inside of \relative
since getting the equivalent of \relative f { c' c' } is often
undesirable.  I am not sure that p (should or shouldn't it include
chords?) would really help here, one could also use
q =
#(define-music-function (parser location m) (ly:music?)
  (if (music-is-of-type? m 'rhythmic-event) #{ <$m> #} m))

And then use #{ \q $x q q q #} in a music function that might have
either e' or <e' g'> as its argument x.

> If not, I'm accustomed to its absense, no there's no harm in
> discussion.
>
>> Note names should be short enough on their own to make this not
>> really worth the trouble.
>
> I don't consider 'character length' a relevant argument either
> for or against.  Durations are short enough, too.

But leaving them off altogether rather than having to write something
else makes more of a difference.

> It's about compressing out the redundant information in the lilypond
> input notation so that when you take a motif and change the pitches
> involved you have fewer moving parts to worry about.  I may be more
> alone in facing this problem than I had thought.

That's more an editing than a representation problem in my opinion.

> So I'll leave my proposal at this stage.  I was not aware that
>
> f
>
>
>
>
>
>                                                              4
>
> was the same as
>
> f4
>
> so I can see that my proposal breaks the current syntax, which 
> is certainly a drawback.  But I feel like I have at least
> sufficiently outlined my idea.

Well, one always has to reconcile change proposals with existing syntax
and its choices.  That does not mean that everything is cast into stone,
but "spaces are insignificant between syntax elements and can be left
out or included at will" is a rather central piece of LilyPond syntax,
even though there are places where by _convention_ you usually would not
write one.

-- 
David Kastrup




reply via email to

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