Group: http://groups.google.com/group/abc4j/topics
- Can I circle a note? [1 Update]
Topic: Can I circle a note?Divine <divin...@gmail.com> Nov 20 01:06PM -0800 ^
--
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);
}
You received this message because you are subscribed to the Google Groups "abc4j" group.
To post to this group, send email to ab...@googlegroups.com.
To unsubscribe from this group, send email to abc4j+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/abc4j?hl=en.