Can I circle a note?

13 views
Skip to first unread message

Divine

unread,
Nov 20, 2010, 4:06:59 PM11/20/10
to abc4j
Hi, I am new to abc4j,
What I want to do with it is to render some notes using the library
and then draw something extra.
e.g. I want to circle a note that is wrongly played.

I think I first need to get the positions of the notes rendered.
I have read the article here: http://groups.google.com/group/abc4j/browse_thread/thread/2289cd2b603d4cd6
But I do not fully understand it. May you give me a more complete
example?

I really appreciate your help.

In the following code, I tried to get the (x,y) coordinates of a
particular note so that I can do something on it.
But it seems it is not the correct way of doing it.

public static void main(String[] args) {

Tune tune = new Tune();
Tune.Music music = tune.getMusic();
Note aNote = new Note(Note.F);

music.addElement(aNote);

JScoreComponent scoreUI =new JScoreComponent();

double x =
scoreUI.getRenditionElementFor(aNote).getBoundingBox().getX();
double y =
scoreUI.getRenditionElementFor(aNote).getBoundingBox().getY();

scoreUI.setTune(tune);
JFrame j = new JFrame();
j.add(scoreUI);
j.pack();
j.setVisible(true);
}
Reply all
Reply to author
Forward
0 new messages