lilypond-user
[Top][All Lists]
Advanced

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

Re: ANN: MIDI input plugin for jEdit


From: Bertalan Fodor
Subject: Re: ANN: MIDI input plugin for jEdit
Date: Thu, 01 Jan 2009 23:35:21 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

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 <address@hidden>:
  
Remember you can use lilypondtool's NoteNameMap and Note class for quite interesting things. Possibly for this as well.


    

  


reply via email to

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