lilypond-devel
[Top][All Lists]
Advanced

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

Re: note-name-engraver: add user-defined note names support (issue 85930


From: janek . lilypond
Subject: Re: note-name-engraver: add user-defined note names support (issue 8593046)
Date: Sun, 21 Apr 2013 21:09:30 +0000

Hi,

On 2013/04/20 00:03:17, fanziye1 wrote:
Hi Janek,
It seems I forgot to publish this issue in list. This is for
the googlecode issue 1367. Only a few c++ code was added,
nothing done with regression test and docs. Was it appropriate
to post a patch like this? Or is there anything I should
do for an issue? I think I will add them later.

It's ok to post an incomplete patch asking for suggestions.
Of course, any related documentation changes etc. should be
added to the patch before its pushed.

note-name-engraver: add user-defined note names support

Property "noteNameList" added in order to display
note names in languages other than Deutsch.

Actually, current language is Dutch, not German.

Example:
\version "2.13.37"
\include "espanol.ly"
notes = \relative do' { do re mi do }

\new Staff <<
   \notes
   \context NoteNames {
     \set noteNameList = #'("la" "si" "do" "re" "mi" "fa" "sol")
     \notes }
>>

As for the code, i think that it would be better to get
notenames from within lilypond instead of asking the
user to specify them.  A comment in the tracker issue
says "do it just like \displayLilyMusic does", so i've
tried some searching.  grep showed that \displayLilyMusic
is defined in ly/music-functions-init.ly using Scheme
function display-lily-music, which in turn is defined
in scm/music-functions.scm. It seems that most of this
stuff lives in scm/define-music-display-methods.scm.
Also in the tracker is mentioned the property "pitchnames"
which seems to be holding the names in appropriate language.
I think that you should be able to access it in C++ using
get_property ("pitchnames").

hth.
Janek


https://codereview.appspot.com/8593046/diff/1/lily/note-name-engraver.cc
File lily/note-name-engraver.cc (right):

https://codereview.appspot.com/8593046/diff/1/lily/note-name-engraver.cc#newcode51
lily/note-name-engraver.cc:51: int note_name_list_length =
scm_to_int(scm_length(scm_note_name_list));
a general note: we have some rules for how C++ code should be formatted
so that our source files will have a uniform appearance.  The easiest
way to ensure that your code complies with them is to run
scripts/auxiliar/fixcc.py on it - please do this when you upload a
patch.

https://codereview.appspot.com/8593046/diff/1/lily/note-name-engraver.cc#newcode54
lily/note-name-engraver.cc:54: note_name_list.push_back (ly_scm2string
(scm_list_ref (scm_note_name_list, scm_from_int(i))));
as a general rule, please try to keep lines under 80 characters long if
possible.

https://codereview.appspot.com/8593046/



reply via email to

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