lilypond-user
[Top][All Lists]
Advanced

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

Re: automatic fingering annotation


From: David Nalesnik
Subject: Re: automatic fingering annotation
Date: Sun, 12 Oct 2014 09:34:18 -0500

Hi Erik,

On Sun, Oct 12, 2014 at 2:35 AM, erik flister <address@hidden> wrote:
hi-

i'm writing some software that generates .ly files and want to offer
the option to automatically add (woodwind) fingering chart annotations
to the engraving.  the project is in haskell and i'd rather not learn
scheme or lilypond internals.  the problem is determining the octave
-- i want to support relative octave entry
(http://lilypond.org/doc/v2.18/Documentation/notation/writing-pitches#relative-octave-entry),
but i don't want to reimplement relative octave detection (not because
it's hard, but i in principle don't want to duplicate logic).

i would think automatic fingering annotation would be a desirable
feature in lilypond itself -- perhaps a markup flag where i request
the standard fingering for the note, maybe some way of selecting a
predefined alternate fingering (nice to have would be rules for
determining prefered fingerings from the previous note, a way to
define fingering libraries to choose from, etc).

i assume that wouldn't be anyone's priority to implement, so either i
could try to myself from within lilypond, or (my preference) i need
some way to ask lilypond for the octave -- either an API or
command-line program or something where i give an .ly snippet and
lilypond gives me back the absolute pitches.

I can't offer any suggestions about manipulating the text file, but I hope the following will be useful to you.

It is possible to create markups in the score through a Scheme engraver.  The one I've attached looks for a NoteHead that has had its 'display-property property set to #t.

(Aside 1:This is an invented property, and there is currently no good way to add a property except by adding it to the codebase.  This method will probably cause problems if you try to process a batch of files--though removing the "symbol redefined" error will likely "fix" that.)

(Aside 2: I've thought for a long time that adding a generic marker property to grobs would be very useful: store whatever you want in it to act as an ID.)

This engraver prints the octave of notes in the score by way of a markup command \placeholder, where you could substitute whatever logic goes into making woodwind diagrams.   You'll want other info about the pitch, of course, and there are Scheme functions for that.  See  http://lilypond.org/doc/v2.18/Documentation/internals/scheme-functions.

Best,

David

Attachment: woodwind-engraver.ly
Description: Text Data

Attachment: woodwind-engraver.png
Description: PNG image


reply via email to

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