You can use parts of LilyPondTool in your macros.
There are two important classes in your case:
1.
lilytool.macrohelp.NoteNameMap.
It is used like this:
NoteNameMap.NM.method(), that is you always call NoteNameMap.NM and not
just NoteNameMap (this again sux, but is a quite old class, from my
younger years :-))
So for example, you can get a list of enharmonics for a given piano key
position:
For example
NoteNameMap.NM.getEnharmonics(1) - will give back a String array:
{"cis", "des", "bisis"}
Then, you can choose one, and get the german name for example by using:
NoteNameMap.NM.getName("bisis", "deutsch") which will result in "hisis".
2.
lilytool.macrohelp.Note
It has a method: nextEnharmonic()
For example (in the simplest case) if you want to get the enharmonics of
cis.
Note note = new Note("cis", 0);
This constructor uses an id (which is actually equals to the nederlands
name, which is the simplest c cis cisis ces ceses, and so forth).
Actually this will create the note in c major, so it may become des, if
this position (the first black key on the piano)
Then, you can call note.nextEnharmonic() to get an enharmonic.
Actually this implementation sucks, and currently under rewrite, but can
be used, though I would prefer using just NoteNameMap instead.
There are other useful methods, so I suggest looking at the sources.
Stefan Thomas írta:
Dear Bertalan,
I don't know the NoteNameMap and Note class. Can You explain me what it is?
2009/1/1 Bertalan Fodor <[email protected]>:
Remember you can use lilypondtool's NoteNameMap and Note class for quite
interesting things. Possibly for this as well.
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user