lilypond-devel
[Top][All Lists]
Advanced

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

[PATCH] Optionally add text to metronome marks (i.e. allow \tempo "Alleg


From: Reinhold Kainhofer
Subject: [PATCH] Optionally add text to metronome marks (i.e. allow \tempo "Allegro" 4=120)
Date: Sat, 7 Jun 2008 00:55:49 +0200

A tempo indication in general is either a text markup, a note=count or both. 
So far, lilypond only supported the note=count type of tempo indications in 
its \tempo command.

I'm now trying to extend the \tempo function, so that it includes an optional 
text markup, which is displayed in the tempo mark (e.g. 
http://lsr.dsi.unimi.it/LSR/Item?id=444). My idea is to allow any of the 
following types of tempo settings:
    \tempo 4=120 
    \tempo "Allegro" 4=120
    \tempo "Allegro"
    \tempo \markup{\italic \medium "Allegro"}
etc.

Attached is a patch (for current master), which is my first attempt to implent 
this. The patch is not perfect yet, but works really well. What it does:
  - Extend the parser to allow the above forms for \tempo
  - Add a tempoText property, similar to tempoUnitCount
  - Metronome_mark_engraver uses this property and checks whether it has
     changed
  - Extend the metronomeMarkFormatter to take four arguments (text, duration,
    count, context) and print either the text, the note=count or text
    (note=count), depending on whether the properties are set to sensible
    values.

What is still missing:
-) The metronomeMarkFormatter function looks ugly and could probably be
     simplified
-) The things in brackets should use \concat
-) Extend the define-extra-display-method to also check for tempoText and
    produce any of the allowed \tempo forms when you use \displayLilyMusic

So, in short, the patch is really on its way, but not yet ready for inclusion 
in master. With this mail I simply want to know if I'm on the right track 
with the patch and what could/should be done differently. (E.g. should the 
metronomeMarkFormatter include the logic whether to print text, note=count or 
both, or should that go into the engraver? Am I using the right methods to 
check for sensible values? etc.)

So, what shall I change in the patch?

An example file is also attached, which uses any of the \tempo forms given 
above. Apparently, it will only run with the patch applied...
Apparently, the PDF is too large for the mailing list (its 30kB binary), so I 
uploaded it to our server:
http://www.fam.tuwien.ac.at/~reinhold/temp/metronome-test.pdf

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/

Attachment: 0001-First-attempt-to-include-text-in-tempo-indications.patch
Description: Text Data

Attachment: metronome-test.ly
Description: Text Data


reply via email to

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