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: fanziye1
Subject: Re: note-name-engraver: add user-defined note names support (issue 8593046)
Date: Wed, 24 Apr 2013 17:16:14 +0000

I found the variable 'pitchnames'(Thanks for your teaching:).
There is a note-name->lily-string procedure can be used to get a pitch's
name. Now I want to use it in C++ code. According to the Guile
Reference, 'gh_call' seems a right choice. But I found no appearance of
'gh_call' in lily/*.cc . So how do you call a scheme procedure from C++
in lilypond?


On 2013/04/21 21:09:30, janek wrote:
Hi,

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.

Actually, current language is Dutch, not German.

I'm sorry. I'll correct it.

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.

Thank you very much. I'll try to rewrite the patch and add related
documentation changes. but now that I've uploaded a patch here, how
could I modify it (or add new changes)? should I upload new patch to the
same googlecode issue?


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



reply via email to

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