[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Re: Octavation syntax consistency (was: grand predefined-command
From: |
Reinhold Kainhofer |
Subject: |
[PATCH] Re: Octavation syntax consistency (was: grand predefined-command thread) |
Date: |
Sat, 28 Jun 2008 14:12:04 +0200 |
User-agent: |
KMail/1.9.9 |
Am Samstag, 28. Juni 2008 schrieb Reinhold Kainhofer:
> Am Samstag, 28. Juni 2008 schrieb Valentin Villenave:
> > This is not really a predef, but for the past couple of weeks I've
> > been trying to implement an easier syntax for octavations, e.g.
> >
> > \octava 1
> > or
> > \octava #1
> >
> > instead of
> >
> > #(set-octavation 1)
> >
> > Such a command would be much more consistent with the rest of the
> > (non-Scheme) LilyPond syntax (not to mention much easier to type,
> > since typing the hash character on a French keyboard requires you to
> > twist your arm ;-)...
> >
> > I couldn't come up with a patch, but I thought someone more skilled
> > than me could write it in a sec...
>
> Well, you don't need to be skilled too much, but that part about "a sec" is
> definitely true ;-) Attached is an example.
>
> Basically, you write a music-function and inside that music function you
> simply copy the stripped-down contents (which is only one line, anyway!) of
> the set-octavation function, which is for some strange reason defined as a
> scheme function rather than a music function. What's the reason for this?
> AFAICS, that scheme function is not used inside any other code, so I see no
> reason why that shouldn't be a music function.
>
> So the whole function boils down to:
>
> ottava = #(define-music-function (parser location octave) (number?)
> (_i "set the octavation ")
> (make-ottava-set octave)
> )
Attached is a patch, which adds this music function to LilyPond and
musicxml2ly, together with a conversion rule, docs changes (I don't know
French, so please check if the text there needs to be changed, too!), updated
regression tests, etc.
I choose ottava as the name, since that's the musical term. However, there
might arise some confusion with the function \octave, which I propose to
rename to \octaveCheck (similar to \barNumberCheck) to make its purpose
clearer.
What do you think about this?
Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
0001-New-function-ottava-oct-replaces-set-octavatio.patch
Description: Text Data